Cod sursa(job #2765060)
| Utilizator | Data | 24 iulie 2021 17:21:50 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.46 kb |
#include <fstream>
#include <iostream>
#include <algorithm>
#include <unordered_set>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int x, n, op;
unordered_set<int> us;
int main() {
fin >> n;
for (; n != 0; n--) {
fin >> op >> x;
if (op == 1)
us.insert(x);
else if (op == 2)
us.erase(x);
else if (op == 3)
fout << (us.count(x)) << '\n';
}
return 0;
}
