Cod sursa(job #3291578)

Utilizator Ruxandra009Ruxandra Vasilescu Ruxandra009 Data 5 aprilie 2025 09:55:12
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda cex_9 Marime 0.44 kb
#include <fstream>
#include <unordered_map>

using namespace std;

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

int n;
unordered_map<int, int> fr;

int main()
{
    f >> n;
    for(int i = 1; i <= n; i ++)
    {
        int tip, x; f >> tip >> x;
        if(tip == 1)
            fr[x] = 1;

        else if(tip == 2)
            fr[x] = 0;

        else
            g << fr[x] << '\n';
    }
    return 0;
}