Pagini recente » Cod sursa (job #2980207) | Cod sursa (job #1541117) | Cod sursa (job #1829851) | Cod sursa (job #1463188) | Cod sursa (job #2590907)
#include <cstdio>
#include <unordered_set>
using namespace std;
int main()
{
freopen("hashuri.in", "r", stdin);
freopen("hashuri.out", "w", stdout);
int N;
scanf("%d", &N);
unordered_set<int> S;
for (int i = 0; i < N; ++i) {
int op, x;
scanf("%d%d", &op, &x);
if (op == 1 && S.count(x) == 0) S.insert(x);
if (op == 2 && S.count(x) == 1) S.erase(x);
if (op == 3) printf("%d\n", (int)(S.find(x) != S.end()));
}
return 0;
}