Cod sursa(job #1403191)

Utilizator crysstyanIacob Paul Cristian crysstyan Data 27 martie 2015 08:59:17
Problema Hashuri Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.5 kb
#include <fstream>
#include <unordered_set>

using namespace std;

ifstream f("hashuri.in");
ofstream g("hashuri.out");

unordered_set <int> s;
int nrquiz, test, nr;

int main()
{
    f>>nrquiz;
    while (nrquiz)
    {
        nrquiz--;
        f>>test>>nr;
        if (test==1) s.insert(nr);
        if (test==2) s.erase(nr);
        if (test==3)
        {
            if (s.find(nr)!=s.end()) g<<"1"<<'\n';
            else
            g<<"0\n";
        }
    }
    return 0;
}