Cod sursa(job #2619087)

Utilizator Alex_tz307Lorintz Alexandru Alex_tz307 Data 26 mai 2020 22:27:37
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.46 kb
#include <bits/stdc++.h>

using namespace std;

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

int n, op, x;
unordered_map < int , bool > M;

int main() {
    fin >> n;
    M.reserve (n);
    while (n --) {
        fin >> op >> x;
        if (op == 1) M[x] = true;
        if (op == 2) M[x] = false;
        if (op == 3) {
            if (M[x] == true) fout << "1\n";
            else fout << "0\n";
        }
    }
    return 0;
}