Cod sursa(job #2910635)
Utilizator | Data | 23 iunie 2022 10:20:29 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.53 kb |
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream in ("hashuri.in");
ofstream out ("hashuri.out");
unordered_map <int, int> m;
int main ()
{
int q;
in >> q;
while (q--)
{
int op, x;
in >> op >> x;
if (op == 1)
{
m[x] = 1;
}
if (op == 2)
{
m[x] = 0;
}
if (op == 3)
{
out << m[x] << '\n';
}
}
in.close();
out.close();
return 0;
}