Cod sursa(job #3306816)

Utilizator paulihno15Ciumandru Paul paulihno15 Data 14 august 2025 12:37:18
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.66 kb
#include <bits/stdc++.h>
#define NMAX 4
#define MOD 666013
#define ll long long
#define ull unsigned long long

using namespace std;

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

int n, op, x;
unordered_map<int, int> mp;

int main() {
    ios::sync_with_stdio(false);
    fin.tie(nullptr);
    fout.tie(nullptr);

    fin >> n;

    while (n--) {
        fin >> op >> x;

        if (op == 1) {
            if (mp[x] == 0) {
                mp[x] = 1;
            }
        }
        else if (op == 2) {
            if (mp[x]) {
                mp[x] = 0;
            }
        }
        else {
            fout << (mp[x]) << '\n';
        }
    }
    return 0;
}