Pagini recente » Cod sursa (job #90355) | Cod sursa (job #429759) | Cod sursa (job #422176) | Cod sursa (job #1785378) | Cod sursa (job #1337704)
#include <stdio.h>
#include <map>
using namespace std;
map <int, int> m;
int main(){
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
int n, op, x;
scanf("%d", &n);
while(n--){
scanf("%d %d", &op, &x);
if(op == 1 && m.find(x) == m.end())
m.insert(make_pair(x, x));
if(op == 2)
m.erase(x);
if(op == 3)
printf("%d\n",m.find(x) != m.end());
}
return 0;
}