Mai intai trebuie sa te autentifici.
Cod sursa(job #2058343)
Utilizator | Data | 5 noiembrie 2017 15:09:41 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.55 kb |
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
int n, x, op;
unordered_map <int, bool> v;
int main()
{
in >> n;
for (int i = 1; i <= n; i++)
{
in >> op >> x;
if (op == 1)
v[x] = 1;
else
if (op == 2)
v[x] = 0;
else
{
if (v[x] == 1)
out << 1 << '\n';
else
out << 0 << '\n';
}
}
return 0;
}