Cod sursa(job #2772697)
Utilizator | Stanescu Stefan StefanSan | Data | 2 septembrie 2021 13:00:54 |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.58 kb |
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
unordered_map<int, bool> Hash;
int n, x, y;
int main() {
in >> n;
for(int i = 1; i <= n; i++) {
in >> x >> y;
if(x == 1) {
Hash[y] = true;
} else if(x == 2) {
Hash.erase(y);
} else if(x == 3) {
out << (Hash.find(y) != Hash.end()) << "\n";
}
}
return 0;
}