Cod sursa(job #3206879)
Utilizator | Papacioc Rares-Ioan prares06 | Data | 24 februarie 2024 13:09:57 |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.49 kb |
#include<fstream>
#include<unordered_set>
std::ifstream fin("hashuri.in");
std::ofstream fout("hashuri.out");
std::unordered_set<int> S;
int n, task, x;
int main(){
fin >> n;
while(n--){
fin >> task >> x;
if(task == 1){
S.insert(x);
}
else if(task == 2){
S.erase(x);
}
else if(task == 3){
if(S.find(x) == S.end())
fout << "0\n";
else
fout << "1\n";
}
}
}