Cod sursa(job #3213362)

Utilizator AlexInfoIordachioaiei Alex AlexInfo Data 13 martie 2024 01:28:34
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.67 kb
#include <bits/stdc++.h>

using namespace std;

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

#define pii pair<int, int>
#define pb push_back
#define fi first
#define se second

const int NMAX = 1e6 + 30;
const int INF = 0x3f3f3f3f;

int n, op, x;
unordered_map<int, bool> hm;

void read()
{
    in >> n;
}

void solve()
{
    while (n--)
        {
            in>>op>>x;
            if (op==1) hm[x] = 1;
            else if (op==2) hm[x] = 0;
            else hm[x]==1 ? out<<1<<'\n' : out<<0<<'\n';
        }
}

int main()
{
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);

    read();
    solve();

    return 0;
}