Pagini recente » Cod sursa (job #3313149) | Cod sursa (job #3338909) | Cod sursa (job #332768) | Cod sursa (job #3326033) | Cod sursa (job #3357778)
#include <iostream>
#include <fstream>
#include <unordered_map>
int main() {
std::ifstream input("hashuri.in");
std::ofstream output("hashuri.out");
std::unordered_map<int, bool> hash;
int n;
input >> n;
while (n--) {
int type, x;
input >> type >> x;
if (type == 1) hash[x] = true;
else if (type == 2) hash.erase(x);
else output << (hash.find(x) != hash.end() ? "1\n" : "0\n");
}
return 0;
}