Pagini recente » Cod sursa (job #587640) | Cod sursa (job #1460698) | Cod sursa (job #2346302) | Cod sursa (job #792629) | Cod sursa (job #1788081)
#include <bits/stdc++.h>
using namespace std;
int main() {
ifstream cin("hashuri.in");
ofstream cout("hashuri.out");
cin.tie(0);
ios_base::sync_with_stdio(false);
int n; cin >> n;
unordered_set<int> hash_set;
srand(time(0));
const int xor_const = (rand() << 15) ^ rand();
for (int iter = 0; iter < n; iter += 1) {
int op_type, el; cin >> op_type >> el;
el ^= xor_const;
if (op_type == 1) {
hash_set.insert(el);
} else if (op_type == 2) {
hash_set.erase(el);
} else {
cout << (hash_set.find(el) != hash_set.end()) << '\n';
}
}
return 0;
}