Cod sursa(job #2982387)

Utilizator Elvis_CostinTuca Elvis-Costin Elvis_Costin Data 20 februarie 2023 10:40:04
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.44 kb
#include <bits/stdc++.h>
using namespace std;
string np = "hashuri";
ifstream f(np + ".in");
ofstream g(np + ".out");

// #define f cin
// #define g cout

int n;
unordered_map<int, bool> mp;

int main()
{
    f >> n;
    for (int cer, x; n and f >> cer >> x; n--)
        if (cer == 1)
            mp[x] = 1;
        else if (cer == 2)
            mp[x] = 0;
        else
            g << mp[x] << '\n';

    return 0;
}