Cod sursa(job #3318921)

Utilizator ioanxhIoan Budeanu ioanxh Data 29 octombrie 2025 18:59:29
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.46 kb
#include<bits/stdc++.h>

using namespace std;
const string file="hashuri";
ifstream f(file+".in");
ofstream g(file+".out");
//#define f cin
//#define g cout
unordered_set<int>s;
int main(){
    int n;
    f>>n;
    while (n--) {
        int t,x;
        f>>t>>x;
        if (t==1) s.insert(x);
        else if (t==2) {
            if (s.count(x)) s.erase(x);
        }
        else {
            g<<s.count(x)<<'\n';
        }
    }
    system("pause");
    return 0;
}