Cod sursa(job #733969)
| Utilizator | Data | 13 aprilie 2012 11:36:03 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.41 kb |
#include<cstdio>
#include<tr1/unordered_set>
using namespace std::tr1;
unordered_set<int> hs;
int main()
{
freopen ("hashuri.in","r",stdin);
freopen ("hashuri.out","w",stdout);
int n;
scanf ("%d",&n);
while(n--){
int x,y;
scanf ("%d %d",&x,&y);
switch(x){
case 1:
hs.insert (y);
break;
case 2:
hs.erase (y);
break;
case 3:
printf ("%lu\n",hs.count (y));
break;
}
}
return 0;
}
