Cod sursa(job #2576168)

Utilizator betybety bety bety Data 6 martie 2020 17:41:25
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.46 kb
#include <fstream>
#include <unordered_set>
using namespace std;
ifstream cin("hashuri.in");
ofstream cout("hashuri.out");
unordered_set<int> s;
int main()
{
    int n,op,x;
    cin>>n;
    for(int w=1;w<=n;++w)
    {
        cin>>op>>x;
        if(op==1) s.insert(x);
        else if(op==2) s.erase(x);
        else {
            if(s.find(x)!=s.end())
                cout<<1<<'\n';
            else cout<<0<<'\n';
        }
    }
    return 0;
}