Cod sursa(job #1423512)
| Utilizator | Data | 21 aprilie 2015 22:04:58 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.5 kb |
#include <fstream>
#include <unordered_map>
using namespace std;
unordered_map<int, int> smth;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main()
{
int N;
fin >> N;
for (int op, x; N; N--){
fin >> op >> x;
if (op == 1)
if(!smth.count(x))
smth[x] = 1;
if (op == 2)
if(smth.count(x))
smth[x] = 0;
if (op == 3)
fout << smth[x] << '\n';
}
return 0;
}
