酸酸Charles @ 2019-02-17 14:37:50
using namespace std;
int a[305],b[305],c[305],sum[305],indx[305];
bool compare(int i,int j){
if(sum[i]!=sum[j])return sum[i]>sum[j];
else if(a[i]!=b[j])return a[i]>b[j];
else return i<j;
}
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++){
indx[i]=i;
cin>>a[i]>>b[i]>>c[i];
sum[i]+=(a[i]+b[i]+c[i]);
}
sort(indx,indx+n,compare);
if(n>=5){
for(int i=0;i<5;i++){
cout<<indx[i]+1<<' '<<sum[indx[i]]<<endl;
}
}
else for(int i=0;i<n;i++){
cout<<indx[i]+1<<' '<<sum[indx[i]]<<endl;
}
return 0;
}
by 蒟蒻365 @ 2019-02-17 16:08:08
话说居然能过7个点