Pagini recente » Cod sursa (job #646261) | Cod sursa (job #2502665) | Cod sursa (job #2405454) | Cod sursa (job #1874910) | Cod sursa (job #2700332)
#include <fstream>
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n, i, op, x;
unordered_set<int> v;
int main()
{
f >> n;
for (i = 1; i <= n; i++) {
f >> op >> x;
if (op == 1) {
if (v.find(x) == v.end())
v.insert(x);
}
else if (op == 2) {
if (!(v.find(x) == v.end()))
v.erase(x);
}
else if (op == 3) {
if (v.find(x) == v.end())
g << 0 << '\n';
else
g << 1 << '\n';
}
}
f.close();
g.close();
return 0;
}