Cod sursa(job #3241688)
| Utilizator | Data | 2 septembrie 2024 15:28:28 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.46 kb |
#include <iostream>
#include <fstream>
#include <unordered_set>
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
unordered_set<int> s;
int main(){
int k;
in >> k;
for(int i = 0; i<k; i++){
int x, y;
in >> x >> y;
if(x == 1){
s.insert(y);
}
else if(x == 2){
if(s.find(y) != s.end()) s.erase(y);
}
else{
if(s.find(y) != s.end()) out << 1 << "\n";
else out << 0 << "\n";
}
}
}
