Cod sursa(job #3213632)

Utilizator Alex_DumitrascuAlex Dumitrascu Alex_Dumitrascu Data 13 martie 2024 12:21:09
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.55 kb
#include <bits/stdc++.h>

#define ll long long

//#define fin cin
//#define fout cout

using namespace std;

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

unordered_map <int, int> hash_table;

int main()
{
    fin.tie(0); fin.sync_with_stdio(false);
    int n, a, b; fin>>n;
    for (int i=1; i<=n; i++) {
        fin>>a>>b;
        if (a==1) {
            hash_table[b]=69420;
        }
        if (a==2) {
            hash_table.erase(b);
        }
        if (a==3) {
            fout<<hash_table.count(b)<<'\n';
        }
    }
    return 0;
}