Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
3324 | 邓小龙 | 打字比赛 | C++ | Accepted | 7 MS | 300 KB | 658 | 2024-05-17 16:01:43 |
#include<bits/stdc++.h> using namespace std; struct entrants{ int id,speed,correctness; double score(){ return speed*correctness/100.0; }void input(){ scanf("%d%d",&speed,&correctness); }void output(){ printf("%d %.2lf\n",id,score()); } }entr[3001]; bool cmp(entrants a,entrants b){ if(a.score()!=b.score()) return a.score()>b.score(); else return a.id<b.id; } int main(){ int n; scanf("%d",&n); for(int i=1;i<=n;i++){ entr[i].input(); entr[i].id=i; } sort(entr+1,entr+n+1,cmp); for(int i=1;i<=n;i++) entr[i].output(); return 0; }