Cod sursa(job #239837)
| Utilizator | Data | 5 ianuarie 2009 22:51:18 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.53 kb |
#include <cstdio>
#include <ext/hash_set>
using namespace std;
using namespace __gnu_cxx;
int N;
hash_set<int> S;
int main()
{
freopen("hashuri.in", "rt", stdin);
#ifndef DEBUG
freopen("hashuri.out", "wt", stdout);
#endif
scanf("%d", &N);
for (; N; N--)
{
int type, val;
scanf("%d %d", &type, &val);
if (type == 1)
S.insert(val);
if (type == 2)
S.erase(val);
if (type == 3)
printf("%d\n", (S.find(val) != S.end()));
}
return 0;
}
