Cod sursa(job #2827883)
| Utilizator | Data | 6 ianuarie 2022 15:24:29 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.56 kb |
#include <fstream>
#include <unordered_set>
using namespace std;
//const int nmax=1000000;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
unordered_set <int> s;
int main(){
int n;
fin>>n;
for(int i=1;i<=n;i++){
int x,y;
fin>>x>>y;
if(x==1){
s.insert(y);
}else if(x==2){
s.erase(y);
}else{
if(s.find(y)==s.end()){
fout<<"0\n";
}else{
fout<<"1\n";
}
}
}
return 0;
}
