Cod sursa(job #2765062)

Utilizator Teodor_AxinteAxinte Teodor-Ionut Teodor_Axinte Data 24 iulie 2021 17:25:39
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.45 kb
#include <fstream>
#include <iostream>
#include <unordered_map>

using namespace std;

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

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

int main() {
    fin >> n;
    for (; n != 0; n--) {
        fin >> op >> x;
        if (op == 1)
            M[x] = 1;
        else if (op == 2)
            M.erase(x);
        else if (op == 3)
            fout << (M.find(x) != M.end()) << '\n';

    }
    return 0;
}