Pagini recente » Cod sursa (job #3259658) | Cod sursa (job #490792) | Cod sursa (job #998162) | Cod sursa (job #1534620) | Cod sursa (job #2757281)
#include <fstream>
#include <unordered_set>
using namespace std;
int main()
{
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
fin.sync_with_stdio(false);
fin.tie(0);
int N, op, x;
unordered_set<int> hash;
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;
}