Pagini recente » Cod sursa (job #3341470) | Cod sursa (job #3352856) | Cod sursa (job #3347030) | Cod sursa (job #3324407) | Cod sursa (job #3357916)
#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) {
if (hash.find(x) != hash.end()) hash.erase(x);
}
else {
if (hash.find(x) != hash.end()) output << hash[x] << '\n';
else output << "false\n";
}
}
return 0;
}