Pagini recente » Cod sursa (job #2814757) | Cod sursa (job #186524) | Cod sursa (job #2433962) | Cod sursa (job #2257156) | Cod sursa (job #3131295)
#include <iostream>
#include <unordered_set>
using namespace std;
int main() {
int n;
cin >> n;
unordered_set<int> hashSet;
for (int i = 0; i < n; i++) {
int operation, x;
cin >> operation >> x;
if (operation == 1) {
hashSet.insert(x);
} else if (operation == 2) {
hashSet.erase(x);
} else if (operation == 3) {
if (hashSet.find(x) != hashSet.end()) {
cout << "1\n";
} else {
cout << "0\n";
}
}
}
return 0;
}