Pagini recente » Cod sursa (job #2093238) | Cod sursa (job #1495789) | Cod sursa (job #1116601) | Cod sursa (job #1835010) | Cod sursa (job #1154336)
#include <iostream>
#include <cstdio>
#include <map>
using namespace std;
map<int, int> m;
int n, op, x;
int main()
{
freopen("hashuri.in", "r", stdin);
freopen("hashuri.out", "w", stdout);
scanf("%d", &n);
for(int i=0; i<n; i++){
scanf("%d %d", &op, &x);
if(op == 1){
if(m.find(x)==m.end())
m[x] = 1;
}
else if(op == 2){
if(m.find(x)!=m.end())
m.erase(x);
}
else
printf("%d\n", m.find(x)!=m.end());
}
return 0;
}