Cod sursa(job #2727287)

Utilizator bossu78BossuL bossu78 Data 21 martie 2021 18:40:08
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.3 kb
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n,x,c;
unordered_set<int> s;
int main()
{
    f>>n;
    for(;n;n--)
    {
        f>>c>>x;
        if(c==1)s.insert(x);
        if(c==2)s.erase(x);
        if(c==3)g<<s.count(x)<<'\n';
    }
    return 0;
}