Pagini recente » Cod sursa (job #2698598) | Cod sursa (job #2517610) | Cod sursa (job #748482) | Cod sursa (job #150870) | Cod sursa (job #2737210)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int N, op, x;
unordered_set < int > v;
int main()
{
fin >> N;
for (int i = 1; i <= N; i++) {
fin >> op >> x;
if (op == 1) {
v.insert(x);
}
else if (op == 2) {
v.erase(x);
}
else {
if (v.find(x) != v.end()) {
fout << "1\n";
}
else {
fout << "0\n";
}
}
}
return 0;
}