Pagini recente » Cod sursa (job #782959) | Cod sursa (job #178274) | Cod sursa (job #2251560) | Cod sursa (job #762461) | Cod sursa (job #3130346)
#include <bits/stdc++.h>
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
int main(){
int n , aux;
set<int> s ;
in >> n;
for(int i = 0 ; i < n ; i ++ ){
in >> aux;
if(aux == 1) {
in >> aux;
s.insert(aux);
}
else if (aux == 2){
in >> aux;
s.erase(aux);
}
else{
in >> aux;
auto it = s.find(aux);
if (it != s.end()) {
out << 1 << endl;
} else {
out << 0 << endl;
}
}
}
return 0;
}