Pagini recente » Cod sursa (job #1989226) | Cod sursa (job #575817) | Cod sursa (job #2226167) | Cod sursa (job #68364) | Cod sursa (job #1604607)
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");
map <int,int> h;
int n, nr;
int main()
{
ios_base::sync_with_stdio(false);
int i, op, x;
fin >> n;
for(i=1; i<=n; i++)
{
fin >> op >> x;
if(op==1 && h.find(x)==h.end()) h[x] = ++nr;
if(op==2) h.erase(x);
if(op==3)
{
if(h.find(x)!=h.end()) fout << "1\n";
else fout << "0\n";
}
}
fin.close();
fout.close();
return 0;
}