Cod sursa(job #3315670)

Utilizator Stefanstef99Stefan Puica Stefanstef99 Data 15 octombrie 2025 17:21:59
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.66 kb
#include <bits/stdc++.h>

using namespace std;

ifstream fin("hashuri.in");
ofstream fout("hashuri.out");

/**int fastexpo(int a, int n)
{
    int p = 1;
    while(n)
    {
        if(n % 2 == 1) p = 1LL * p * a % mod;
        a = 1LL * a * a % mod;
        n /= 2;
    }
    return p;
}*/

int n;
unordered_map <int, int> m;

int main()
{
    int op, x;
    fin >> n;
    while(n--)
    {
        fin >> op >> x;
        if(op == 1) m[x] = 1;
        else if(op == 2) m[x] = 0;
        else
        {
            if(m[x] == 1)
                fout << "1\n";
            else
                fout << "0\n";
        }
    }
    return 0;
}