Cod sursa(job #2685343)

Utilizator SochuDarabaneanu Liviu Eugen Sochu Data 16 decembrie 2020 17:53:05
Problema Hashuri Scor 70
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");

int op , x , n;
unordered_set < int > s;

signed main()
{
    f >> n;

    for(int i = 1 ; i <= n ; i++)
    {
        f >> op >> x;

        if(op == 1)
            s.insert(x);
        else if(op == 2)
                s.erase(x);
        else g << s.count(x) << '\n';
    }

    return 0;
}