Cod sursa(job #403523)
| Utilizator | Data | 25 februarie 2010 01:18:16 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.41 kb |
#include <cstdio>
#include <tr1/unordered_set>
using namespace std;
int main()
{
tr1::unordered_set<int> H;
int n, p, q;
freopen ("hashuri.in", "r", stdin);
freopen ("hashuri.out", "w", stdout);
scanf ("%d\n", &n);
while (n--)
{
scanf ("%d %d\n", &p, &q);
if (p == 1)
H.insert (q);
if (p == 2)
H.erase (q);
if (p == 3)
printf ("%d\n", H.find(q) == H.end() ? 0 : 1);
}
return 0;
}
