Cod sursa(job #1883394)

Utilizator AeroHHorea Stefan AeroH Data 17 februarie 2017 22:36:56
Problema Hashuri Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.42 kb
#include <bits/stdc++.h>
using namespace std;
string s = "hashuri";

ifstream f(s+".in");
ofstream g(s+".out");

int n,Q,x;
unordered_set<int> S;

int main()
{
    f>>n;
    while(n--)
        {
            f>>Q>>x;

            if (Q == 1)
                S.insert(x);
            else if (Q == 2)
                S.erase(x);
            else g<<(S.find(x)!=S.end()?1:0)<<'\n';

        }
    return 0;
}