Cod sursa(job #595168)
| Utilizator | Data | 11 iunie 2011 13:01:00 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.53 kb |
# include <cstdio>
# include <ext/hash_map>
using namespace std;
using namespace __gnu_cxx ;
const char *FIN = "hashuri.in", *FOU = "hashuri.out" ;
int N;
hash_map <int, int> M;
int main (void) {
freopen (FIN, "r", stdin) ;
freopen (FOU, "w", stdout) ;
scanf ("%d", &N) ;
for (int i = 1, op, x, cnt = 0; i <= N; ++i) {
scanf ("%d %d", &op, &x) ;
if (op == 1 && M.count (x) == 0) M[x] = ++cnt;
else if (op == 2) M.erase (x);
else printf ("%d\n", M.count (x) > 0) ;
}
}
