Mai intai trebuie sa te autentifici.
Cod sursa(job #3132006)
| Utilizator | Data | 21 mai 2023 22:37:28 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.49 kb |
#include <iostream>
#include <unordered_set>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
unordered_set<int> hashSet;
int n, x, y;
cin >> n;
while (n--) {
cin >> x >> y;
if (x == 1) {
hashSet.insert(y);
} else if (x == 2) {
hashSet.erase(y);
} else if (x == 3) {
cout << (hashSet.count(y) ? 1 : 0) << '\n';
}
}
return 0;
}
