Cod sursa(job #3350984)
| Utilizator | Data | 15 aprilie 2026 14:00:00 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 30 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.58 kb |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main(){
set<int> s;
int n;
fin >> n;
while(n--){
int c,x;
fin >> c >> x;
if(c == 1){
s.insert(x);
}
if(c == 2) s.erase(x);
if(c == 3){
int ok = 0;
auto it = s.begin();
while(it != s.end()){
if(*it == x) ok = 1;
it++;
}
fout << ok << '\n';
}
}
return 0;
}