Pagini recente » Cod sursa (job #1573874) | Cod sursa (job #1883134) | Cod sursa (job #3255802) | Cod sursa (job #854339) | Cod sursa (job #1787350)
#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> m_hash;
m_hash.reserve(1 << 20);
m_hash.max_load_factor(0.5);
while (n--) {
int op_type, x; cin >> op_type >> x;
if (op_type == 1) {
m_hash.insert(x);
} else if (op_type == 2) {
m_hash.erase(x);
} else {
cout << (m_hash.find(x) != m_hash.end()) << '\n';
}
}
return 0;
}