Cod sursa(job #2926496)

Utilizator AleXutzZuDavid Alex Robert AleXutzZu Data 17 octombrie 2022 21:03:45
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.43 kb
#include <iostream>
#include <fstream>
#include <unordered_map>

int main() {
    std::ifstream input("hashuri.in");
    std::ofstream output("hashuri.out");

    std::unordered_map<int, bool> hash;

    int n;
    input >> n;
    while (n--) {
        int type, x;
        input >> type >> x;
        if (type == 1) hash[x] = true;
        else if (type == 2) hash[x] = false;
        else output << hash[x] << '\n';
    }

    return 0;
}