Cod sursa(job #2443531)

Utilizator GabyD002Dobrita Gabriel GabyD002 Data 28 iulie 2019 14:14:31
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.41 kb
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");

unordered_set <int> s;

int main()
{   int n;
    f>>n;
    while(n--)
    {   int t,x;
        f>>t>>x;
        if(t==1)
            if(!s.count(x)) s.insert(x);
        if(t==2)
            if(s.count(x)) s.erase(x);
        if(t==3)
            g<<(s.count(x) ? 1 : 0)<<'\n';
    }
    return 0;
}