Cod sursa(job #2450179)

Utilizator ejoi2019Ejoi 2019 ejoi2019 Data 22 august 2019 11:35:13
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.5 kb
#include <cstdio>
#include <unordered_set>


using namespace std;


int main()
{
        freopen("hashuri.in","r",stdin);
        freopen("hashuri.out","w",stdout);

        int n;
        scanf("%d",&n);
        unordered_set <int> s;
        while(n--)
        {
                int t,x;
                scanf("%d%d",&t,&x);
                if(t==1) s.insert(x);
                if(t==2) s.erase(x);
                if(t==3) printf("%d\n",s.count(x));
        }

        return 0;
}