Cod sursa(job #2024865)

Utilizator CezarTDTodirisca Cezar CezarTD Data 21 septembrie 2017 14:26:17
Problema Hashuri Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.38 kb
#include <bits/stdc++.h>

using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int q,a,b;
unordered_set<int> s;
int main()
{
    f>>q;
    for(;q;q--)
    {
        f>>a>>b;
        if(a==1)
            s.insert(b);
        else if(a==2)
            s.erase(b);
        else
            g<<(s.find(b)==s.end()?0:1)<<'\n';
    }
    return 0;
}