Cod sursa(job #3269223)
Utilizator | Data | 18 ianuarie 2025 14:06:57 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.47 kb |
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n, op, x;
unordered_map <int, bool> m;
int main()
{
f >> n;
while (n--) {
f >> op >> x;
if (op == 1) {
m[x] = 1;
}
else if (op == 2) {
m.erase(x);
}
else {
g << (m.find(x) != m.end()) << '\n';
}
}
return 0;
}