Cod sursa(job #2058345)
Utilizator | Data | 5 noiembrie 2017 15:17:36 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.54 kb |
#include <fstream>
#include <map>
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
int n, x, op;
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;
}