Cod sursa(job #1410343)

Utilizator Vladut-Vlad Panait Vladut- Data 30 martie 2015 23:52:43
Problema Hashuri Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.55 kb
#include <fstream>
#include <unordered_set>

using namespace std;

ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");

unordered_set <int> myHash;
int n, x, op, t;

int main()
{
    for (int i=1; i<=n; i++)
    {
        fin >> op >> x;
        if (op==1)
            myHash.insert(x);
        else if (op==2)
            myHash.erase(x);
            else
                if (myHash.find(x)==myHash.end())
                fout << 0;
                else fout << 1;
    }

    fin.close();
    fout.close();
    return 0;
}