Cod sursa(job #280383)
| Utilizator | Data | 13 martie 2009 12:47:28 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.45 kb |
#include <cstdio>
#include <map>
using namespace std;
int n, w;
map <int, int> m;
int main()
{
freopen("hashuri.in", "r", stdin);
freopen("hashuri.out", "w", stdout);
int t, x;
scanf("%d ", &n);
for (int i = 1; i <= n; i++)
{
scanf("%d %d ", &t, &x);
if (t==1 && m.find(x)==m.end())
m[x] = ++w;
if (t==2)
m.erase(x);
if (t==3)
printf("%d\n", m.find(x) != m.end());
}
return 0;
}
