Cod sursa(job #2892849)
Utilizator | Data | 23 aprilie 2022 19:03:36 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.38 kb |
#include <fstream>
#include <set>
std::set<int> hash;
int main()
{
std::ifstream fin("hashuri.in");
std::ofstream fout("hashuri.out");
int n;
fin >> n;
for (int i = 0; i < n; ++i) {
int op, x;
fin >> op >> x;
if (op == 1) hash.insert(x);
else if (op == 2) hash.erase(x);
else fout << hash.count(x) << '\n';
}
return 0;
}