Cod sursa(job #1171009)
Utilizator | Data | 14 aprilie 2014 23:15:20 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.54 kb |
#include <cstdio>
#include <map>
using namespace std;
map<int,int>v;
int k;
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
int n,i,x,y;
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d%d",&x,&y);
if(x==1 and v.find(y)==v.end())
v[y]=++k;
if(x==2)
v.erase(y);
if(x==3){
if(v.find(y)==v.end())
printf("0\n");
else
printf("1\n");
}
}
return 0;
}