Cod sursa(job #3292992)

Utilizator radugheoRadu Mihai Gheorghe radugheo Data 9 aprilie 2025 22:52:57
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.54 kb
#include <fstream>
#include <set>

using namespace std;

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

int n, op, x;
set<int> s;

int main(){
    fin >> n;
    while (n--){
        fin >> op >> x;
        if (op == 1){
            s.insert(x);
        }
        else if (op == 2){
            s.erase(x);
        }
        else{
            if (s.count(x) != 0){
                fout << 1 << '\n';
            }
            else{
                fout << 0 << '\n';
            }
        }
    }
    return 0;
}