| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 165384 | 孔声豪 | 奖学金 | C++ | Accepted | 1 MS | 272 KB | 567 | 2026-11-15 10:15:12 |
#include<bits/stdc++.h> using namespace std; struct stu{ int xh; int yw; int sx; int yy; double z; }s[301]; bool cup(stu x,stu y){ if(x.z<y.z)return true; else if(x.z==y.z){ if(x.yw<y.yw)return true; else if(x.yw==y.yw)return x.xh>y.xh; } return false; } int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ cin>>s[i].yw>>s[i].sx>>s[i].yy; s[i].xh=i; s[i].z=s[i].yw+s[i].sx+s[i].yy; } for(int i=1;i<n;i++){ for(int j=1;j<n-i;j++)if(cup(s[j],s[j+1]))swap(s[j],s[j+1]); } for(int i=1;i<=5;i++)cout<<s[i].xh<<' '<<s[i].z<<endl; return 0; }