Cod sursa(job #667453)
| Utilizator | Data | 23 ianuarie 2012 10:13:31 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.52 kb |
#include <map>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
map<int,bool> hamap;
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
int n;
scanf("%d",&n);
for(int i=0; i<n; i++)
{
int op,nr;
scanf("%d %d",&op,&nr);
if(op==1)
hamap[nr]=true;
else if(op==2)
hamap.erase(nr);
else if(op==3)
{
if(hamap.find(nr)==hamap.end())
printf("0\n");
else
printf("1\n");
}
}
return 0;
}
