Cod sursa(job #2548627)
| Utilizator | Data | 16 februarie 2020 20:44:36 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.57 kb |
#include<fstream>
#include<iostream>
#include<unordered_map>
using namespace std;
unordered_map<int, int> umap;
int main() {
int n, op, x;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
fin >> n;
for(int i = 1; i <= n; i++) {
fin >> op >> x;
if(op == 1)
umap[x] = 1;
else if(op == 2) {
if(umap[x])
umap[x] = 0;
} else {
if(umap[x])
fout << "1\n";
else fout << "0\n";
}
}
fin.close();
fout.close();
return 0;
}
