Cod sursa(job #3255471)
Utilizator | Data | 10 noiembrie 2024 17:50:37 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.45 kb |
#include <bits/stdc++.h>
using namespace std;
int n;
unordered_map<int, bool> m;
int main() {
ifstream cin("hashuri.in");
ofstream cout("hashuri.out");
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";
}
}
}