Cod sursa(job #3172471)
Utilizator | Data | 20 noiembrie 2023 18:34:19 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.57 kb |
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
unordered_map<int, bool> f;
int main() {
int q;
fin >> q;
while (q--) {
int tip, x;
fin >> tip >> x;
if (tip == 1) {
f[x] = true;
} else if (tip == 2) {
f[x] = false;
} else {
if (f.find(x) == f.end() || !f[x]) {
fout << "0\n";
} else {
fout << "1\n";
}
}
}
return 0;
}