Cod sursa(job #1207047)
| Utilizator | Data | 11 iulie 2014 22:02:35 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.54 kb |
#include <stdio.h>
#include <map>
using namespace std;
map <long,long> Hash;
long n,nr, i, tip, x,aux;
void openfile()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
}
int main()
{
openfile();
scanf("%d",&n);
for (i=1;i<=n;++i){
scanf("%d %d",&aux,&x);
if (aux==1 && Hash.find(x)==Hash.end()) Hash[x]=++nr;
if (aux==2) Hash.erase(x);
if (aux==3) printf("%d\n",Hash.find(x)!=Hash.end());
}
return 0;
}
