Pagini recente » Cod sursa (job #2049307) | Cod sursa (job #3005201) | Cod sursa (job #1157977) | Cod sursa (job #555319) | Cod sursa (job #1154335)
#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;
}