It is important to note that rounding is mostly taken as a percentage. Just press the rounding rule.
#include <iostream> #include <cstring> #include <climits> #include <algorithm> #include < string> #include <vector> #include <map> #include <stack> #include <queue> #include <set&
Gt
#define MAX 10010 using namespace std;
int p,m,n;
struct node{string id;
int gp,gm,gf,final;
Node () {gp=gm=gf=-1;};
};
Node List[max];
int r = 1;
Map <string,int> Str2Int;
BOOL CMP (node n1, node N2) {if (n1.final! = n2.final) return n1.final > n2.final;
else return n1.id < n2.id;
} int main () {scanf ("%d%d%d", &p,&m,&n);
for (int i = 0; i < p; i + +) {string id;
int GP;
CIN >> ID >> GP;
if (GP >=) {list[r].id = ID;
LIST[R].GP = GP;
Str2int[id] = r++;
}} for (int i = 0; i < m; i++) {string id;
int GM;
CIN >> ID >> GM;
int no = Str2int[id];
if (No! = 0) {list[no].gm = GM;
}} for (int i = 0; i < n; i++) {string id;
int GF; cin >> ID >> GF;
int no = Str2int[id];
if (No! = 0) {LIST[NO].GF = GF; }} for (int i = 1; i < r;i++) {if (List[i].gm > LIST[I].GF) {list[i].final = LIST[I].GM * + LIST[I].GF *
60;
if (list[i].final% >=) {list[i].final = list[i].final/100 + 1;
} else list[i].final = list[i].final/100;
} else list[i].final = LIST[I].GF;
} sort (list + 1, List + 1 + r,cmp); for (int i = 1; i < r;i++) {if (list[i].final >=) cout << list[i].id << "<< list[i].gp &L
t;< "" << list[i].gm << "" << list[i].gf << "<< list[i].final << Endl;
} return 0; }