Cod sursa(job #1309249)
| Utilizator | Data | 5 ianuarie 2015 16:39:14 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.58 kb |
#include <cstdio>
#include <map>
using namespace std;
int n, type, i, x, qq;
map<int, int> kush;
int main ()
{
freopen("hashuri.in", "rt", stdin);
freopen("hashuri.out", "wt", stdout);
scanf("%d", &n);
for(i=1; i<=n; ++i)
{
scanf("%d%d", &type, &x);
if(type==1)
{
if(kush.find(x)==kush.end()) kush[x]=++qq;
continue;
}
if(type==2)
{
kush.erase(x);
continue;
}
printf("%d\n", kush.find(x)!=kush.end());
}
return 0;
}
