Pagini recente » Cod sursa (job #2185255) | Cod sursa (job #2430199) | Cod sursa (job #2235256) | Cod sursa (job #114486) | Cod sursa (job #1264406)
#include <fstream>
#include <set>
using namespace std;
set<int> h;
int main()
{
int i, n, x, op;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
fin >> n;
for (i = 1; i <= n; ++i)
{
fin >> op >>x;
if (op == 1) h.insert(x);
else if (op == 2) h.erase(x);
else if (h.find(x) == h.end()) fout << "0\n";
else fout << "1\n";
}
fin.close();
fout.close();
return 0;
}