Cod sursa(job #3291640)

Utilizator Radu_BicliBiclineru Radu Radu_Bicli Data 5 aprilie 2025 11:12:36
Problema Hashuri Scor 0
Compilator cpp-64 Status done
Runda cex_9 Marime 0.41 kb
#include <bits/stdc++.h>

using namespace std;

ifstream fin("strmatch.in");
ofstream fout("strmatch.out");
set<int> fr;
int n;

int main() {
    fin >> n;
    while(n--) {
	int op, x;
	fin >> op >> x;
	if(op == 1) fr.insert(x);
	else if(op == 2) {
	    set<int>::iterator poz = fr.find(x);
	    if(poz != fr.end()) fr.erase(poz);
	}
	else fout << (fr.count(x) > 0) << "\n";
    }

    return 0;
}