Cod sursa(job #608296)
| Utilizator | Data | 16 august 2011 03:26:22 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.42 kb |
#include<stdio.h>
#include<hash_set.h>
using namespace std;
//using namespace __gnu_cxx;
hash_set<int,hash<int> > h;
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
int n,x,y;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%d %d",&x,&y);
if(x==1) h.insert(y);
else if(x==2) h.erase(y);
else if(x==3) printf("%d\n",h.end()!=h.find(y));
}
}