Cod sursa(job #239836)

Utilizator bogdan2412Bogdan-Cristian Tataroiu bogdan2412 Data 5 ianuarie 2009 22:50:46
Problema Hashuri Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.53 kb
#include <cstdio>
#include <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;
}