Mai intai trebuie sa te autentifici.
Cod sursa(job #518877)
Utilizator | Data | 3 ianuarie 2011 13:48:20 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.44 kb |
#include<cstdio>
#include<map>
using namespace std;
int n, ct;
map <int,int> h;
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
int tip, val;
scanf("%d",&n);
while(n--)
{
scanf("%d%d",&tip,&val);
if(tip==1 && h.find(val)==h.end())
h[val]=ct++;
else if(tip==2)
h.erase(val);
else if(tip==3)
printf("%d\n",h.find(val)!=h.end());
}
return 0;
}