Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
314388 | 242320奚姚君 | NOIP2007 普及:第一题 奖学金 | C++ | Wrong Answer | 90 | 0 MS | 284 KB | 593 | 2024-12-12 23:08:27 |
#include<bits/stdc++.h> using namespace std; struct node { int id,fs,yw,sx,yy; }; node a[302],b[302]; bool cmp(node x,node y) { if(x.fs==y.fs){ if(x.yw==y.yw){ if(x.sx==y.sx){ return x.yy>y.yy; } else return x.sx >y.sx; } else return x.yw >y.yw; } else return x.fs >y.fs; } int main(){ int n,c[302],d[302]; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i].yw >>a[i].sx >>a[i].yy; a[i].id=i; a[i].fs=a[i].yw +a[i].sx+a[i].yy; } sort(a+1,a+1+n,cmp); for(int i=1;i<=5;i++){ cout<<a[i].id <<' '<<a[i].fs<<endl; } return 0; }