Pagini recente » Cod sursa (job #1603344) | Cod sursa (job #2254258) | Cod sursa (job #3306748) | Cod sursa (job #3331402) | Cod sursa (job #3312860)
#include <bits/stdc++.h>
using namespace std;
#define i32 int32_t
#define i64 int64_t
int main() {
#ifndef LOCAL
freopen("hashuri.in", "r", stdin);
freopen("hashuri.out", "w", stdout);
#endif
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
unordered_set<int> h;
for (; n--;) {
int o;
int x;
cin >> o >> x;
auto i = h.find(x);
switch (--o) {
case 0:
if (i == h.end()) {
h.insert(x);
}
break;
case 1:
if (i != h.end()) {
h.erase(x);
}
break;
case 2:
cout << (i != h.end()) << endl;
break;
}
}
return 0;
}