Cod sursa(job #2619092)

Utilizator k2e0e0w3qDumitrescu Gheorghe k2e0e0w3q Data 26 mai 2020 22:29:54
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.51 kb
#include <bits/stdc++.h>
using namespace std;

unordered_map <int, bool> H;
int main () {
    ifstream fin ("hashuri.in");
    ofstream fout ("hashuri.out");

    int n, key, x;
    fin >> n;
    H.reserve(n);

    for (; n; --n) {
        fin >> key >> x;
        switch (key) {
        case 1:
            H[x]=1;
            break;
        case 2:
            H[x]=0;
            break;
        case 3:
            fout << H[x] << '\n';
            break;
        }
    }
    return 0;
}