Cod sursa(job #3159476)

Utilizator Maftei_TudorMaftei Tudor Maftei_Tudor Data 21 octombrie 2023 12:58:03
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.4 kb
#include <fstream>
#include <unordered_map>

using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");

int q, tip, x;
unordered_map<int, bool> fr;

int main()
{
    in >> q;
    while(q--) {
        in >> tip >> x;
        if(tip == 1)
            fr[x] = 1;
        else if(tip == 2)
            fr[x] = 0;
        else out << fr[x] << '\n';
    }
    return 0;
}