Cod sursa(job #2370654)
Utilizator | Data | 6 martie 2019 12:59:27 | |
---|---|---|---|
Problema | Hashuri | Scor | 20 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.46 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");
unordered_map < int , bool > M;
int main()
{
int x , op , n;
fin >> n;
for(int i = 1 ; i <= n ; i++)
{
fin >> op >> x;
if(op == 1 && !M[x])
M[x] = true;
else if(op == 2)
M[x] = false;
else fout << M[x] << "\n";
}
fin.close();
fout.close();
}