Pagini recente » Cod sursa (job #132882) | Cod sursa (job #345547) | Cod sursa (job #2222101) | Cod sursa (job #1723058) | Cod sursa (job #1337707)
#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, nr = 0;
scanf("%d", &n);
while(n--){
scanf("%d %d", &op, &x);
if(op == 1 && m.find(x) == m.end())
m[x] = ++nr;
if(op == 2)
m.erase(x);
if(op == 3)
printf("%d\n",m.find(x) != m.end());
}
return 0;
}