Cod sursa(job #2159435)
| Utilizator | Data | 10 martie 2018 22:23:07 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.52 kb |
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
int n;
unordered_map<int, int> Map;
int main()
{
in >> n;
for (int i = 1, o, x; i <= n; ++i) {
in >> o >> x;
if (o == 1) {
Map[x] = 1;
} else if (o == 2) {
Map[x] = 0;
} else if (o == 3) {
if (Map[x]) out << 1; else out << 0;
out << "\n";
}
}
return 0;
}
