Cod sursa(job #1771125)
Utilizator | Data | 5 octombrie 2016 11:30:58 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.42 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n;
map<int, bool> f;
int main()
{
int op, x;
fin >> n;
for (; n; --n) {
fin >> op >> x;
switch (op) {
case 1: f[x] = 1; break;
case 2: f[x] = 0; break;
case 3: fout << int(f[x]) << '\n'; break;
}
}
return 0;
}