Cod sursa(job #3289178)

Utilizator Cristian_NegoitaCristian Negoita Cristian_Negoita Data 25 martie 2025 22:47:23
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.49 kb
#include <bits/stdc++.h>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");

signed main()
{
    ios_base::sync_with_stdio(false);
    fin.tie(nullptr);

    unordered_set<int> ap;
    int n;
    fin >> n;
    while(n--)
    {
        int op, x;
        fin >> op >> x;
        if(op == 1)
            ap.insert(x);
        else if(op == 2)
            ap.erase(x);
        else
            fout << ap.count(x) << '\n';
    }

    return 0;
}