Pagini recente » Cod sursa (job #2363994) | Cod sursa (job #2393924) | Cod sursa (job #1427020) | Cod sursa (job #13220) | Cod sursa (job #2757283)
#include <fstream>
#include <unordered_set>
using namespace std;
int N, op, x;
unordered_set<int> hash;
int main()
{
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
fin.sync_with_stdio(false);
fin.tie(0);
fin >> N;
for (int i = 0; i < N; ++i) {
fin >> op >> x;
if (op == 1) {
hash.insert(x);
continue;
}
if (op == 2) {
hash.erase(x);
continue;
}
fout << (hash.find(x) != hash.end()) << "\n";
}
return 0;
}