Cod sursa(job #2722607)

Utilizator witekIani Ispas witek Data 13 martie 2021 01:10:08
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.43 kb
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;

ifstream f("hashuri.in");
ofstream g("hashuri.out");

int n, nr;
unordered_map <int, bool> m;

int main()
{
    f >> n;
    int x, op;
    for(int i = 1; i <= n; ++i) {
        f >> op >> x;
        if(op == 1)
            m[x] = true;
        else if(op == 2)
            m[x] = false;
        else g << m[x] << "\n";
    }
}