Cod sursa(job #716961)
| Utilizator | Data | 19 martie 2012 14:14:28 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.49 kb |
#include <stdio.h>
#include <map>
using namespace std;
int n,op,x;
map <int,char> hs;
int main()
{
freopen ("hashuri.in","r",stdin);
freopen ("hashuri.out","w",stdout);
scanf("%d", &n);
for(int i=1;i<=n;++i)
{
scanf("%d %d", &op, &x);
if(op==1 && hs.find(x)==hs.end())
hs[x] = 0;
else if(op==2)
hs.erase(x);
else if(op==3)
printf("%d\n", hs.find(x)!=hs.end());
}
return 0;
}
