Pagini recente » Cod sursa (job #991475) | Cod sursa (job #13697) | Cod sursa (job #3250398) | Cod sursa (job #426556) | Cod sursa (job #1787348)
#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.25);
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;
}