| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 157055 | 张浩然 | 奖学金 | C++ | Wrong Answer | 1 MS | 284 KB | 655 | 2026-07-13 14:13:47 |
#include<bits/stdc++.h> using namespace std; struct student{ int id; int cj[3]; }; bool cmp(student a,student b){ if(a.cj[0]+a.cj[1]+a.cj[2]>b.cj[0]+b.cj[1]+b.cj[2]){ return 1; }else if(a.cj[0]+a.cj[1]+a.cj[2]==b.cj[0]+b.cj[1]+b.cj[2]){ if(a.cj[0]>b.cj[0]){ return 1; }else if(a.cj[0]==b.cj[0]){ if(a.id>b.id){ return 1; } } } return 0; } int main(){ int n; cin>>n; student x[n]; for(int i=1;i<=n;i++){ cin>>x[i-1].cj[1]>>x[i-1].cj[1]>>x[i-1].cj[2]; x[i-1].id=i; } sort(x+0,x+n,cmp); for(int i=0;i<5;i++){ cout<<x[i].id<<" "<<x[i].cj[0]+x[i].cj[1]+x[i].cj[2]<<endl; } return 0; }
------Input------
299 45 41 28 13 12 87 50 44 24 27 70 84 60 41 31 3 76 25 83 32 91 94 74 61 81 46 40 36 46 38 19 11 100 0 97 97 92 91 3 4 15 28 65 98 16 14 23 75 39 74 81 95 18 15 86 92 90 98 91 11 54 95 17 1 92 35 80 85 57 31 77 61 60 76 96 39 31 85 58 2 45 59 5 47 2 3 36 48 59 8 48 72 33 35 20 61 71 69 45 30 32 80 16 81 7 63 5 42 89 93 34 16 27 83 78 42 29 76 24 79 57 28 78 67 74 11 59 7 95 95 10 10 41 1 85 35 45 38 62 2 6 69 58 94 98 44 53 22 32 0 75 45 77 75 63 14 78 92 64 88 18 46 25 24 84 65 56 21 85 48 52
------Answer-----
177 275 19 268 88 252 62 244 185 243
------Your output-----
291 32933 284 32922 285 32920 296 32909 283 32909