Cod sursa(job #2891983)

Utilizator Andrei-27Arhire Andrei Andrei-27 Data 20 aprilie 2022 13:05:36
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.38 kb
#include <bits/stdc++.h>

using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
int n, tip, x;
unordered_set<int> m;

int main() {
    ios::sync_with_stdio(false);
    cin.tie();
    in >> n;
    while (n--) {
        in >> tip >> x;
        if (tip == 1) m.insert(x);
        if (tip == 2) m.erase(x);
        if (tip == 3) out << (m.count(x)) << '\n';
    }
}