Cod sursa(job #2001952)

Utilizator alpiPitrop Alexandru-Petre alpi Data 18 iulie 2017 10:54:57
Problema Hashuri Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.4 kb
#include <bits/stdc++.h>

using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
unordered_set<int> s;
int n,c,x;

int main()
{
    f>>n;
    for(;n;n--)
    {
        f>>c>>x;
        if(c==1)
            s.insert(x);
        else
            if(c==2)
                s.erase(x);
        else
            s.find(x)==s.end()?g<<"0\n":g<<"1\n";
    }
    return 0;
}