Cod sursa(job #2239681)
| Utilizator | Data | 11 septembrie 2018 17:19:09 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.44 kb |
#include <cstdio>
#include <unordered_set>
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
std::unordered_set<int> hash; //nu merita ceva mai complicat :)
int n,i,op,x;
scanf("%d",&n);
for(i=0;i<n;i++) {
scanf("%d %d",&op,&x);
if(op==1) hash.insert(x);
if(op==2) hash.erase(x);
if(op==3) printf("%d\n",hash.count(x));
}
return 0;
}
