Cod sursa(job #3255470)
Utilizator | Data | 10 noiembrie 2024 17:50:23 | |
---|---|---|---|
Problema | Hashuri | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.39 kb |
#include <bits/stdc++.h>
using namespace std;
int n;
unordered_map<int, bool> m;
int main() {
cin >> n;
for (int i = 1; i <= n; ++i) {
int op, x;
cin >> op >> x;
if (op == 1) {
m[x] = true;
} else if (op == 2) {
m.erase(x);
} else {
cout << (m.find(x) != m.end()) << "\n";
}
}
}