Cod sursa(job #2404486)

Utilizator ezioconnorVlad - Gabriel Iftimescu ezioconnor Data 12 aprilie 2019 21:11:54
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.48 kb
#include <bits/stdc++.h>

using namespace std;

ifstream in("hashuri.in");
ofstream out("hashuri.out");

int k;
unordered_set <int> m;

int main()
{
    int n, p, a;
    in >> n;
    for (int i = 1; i <= n; ++i)
    {
        in >> p >> a;
        if (p == 1)
            m.insert(a);
        else if (p == 2)
        {
            if (m.count(a))
                m.erase(a);
        }
        else
            out << (m.count(a)) << '\n';
    }
    return 0;
}