Cod sursa(job #1058240)
| Utilizator | Data | 15 decembrie 2013 12:21:30 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.42 kb |
#include <fstream>
#include <map>
std::ifstream fin ("hashuri.in");
std::ofstream fout ("hashuri.out");
int n, ind;
std::map <int, int> H;
int main(){
fin >> n;
int op, val;
for(int i = 0; i < n; i++){
fin >> op >> val;
if(op == 1){
if(H.find(val) == H.end()) H[val] = i;
}
if(op == 2){
H.erase(val);
}
if(op == 3){
fout << (H.find(val) != H.end()) << "\n";
}
}
return 0;
}