神贴搬运工 @ 2020-07-31 13:27:36
#include<bits/stdc++.h>
using namespace std;
struct node
{
int x1,x2,x3,zong,id;
}a[1001];
bool cmp(node x,node y)
{
if(x.zong!=y.zong)
{
return x.zong>y.zong;
}
else
{
return x.id<y.id;
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.precision(10);
cout<<fixed;
int n,i;
cin>>n;
for(i=1;i<=n;i++)
{
cin>>a[i].x1>>a[i].x2>>a[i].x3;
a[i].id=i;
a[i].zong=a[i].x1+a[i].x2+a[i].x3;
}
sort(a+1,a+n+1,cmp);
for(i=1;i<=5;i++)
{
cout<<a[i].id<<" "<<a[i].zong<<"\n";
}
}
by Ex90r @ 2020-08-04 20:50:49
@牛奶小咖啡 欸欸欸窝也是小五pj省二的不过我们这边是蒻省(AH)110就能拿省二了(更惭愧)
by Ex90r @ 2020-08-04 20:51:44
@牛奶小咖啡 您pj2但是是红名说明您的真实实力很强%%%
by MilkyCoffee @ 2020-08-04 20:55:42
@TLE自动机_ 啊啊啊??110分???
by MilkyCoffee @ 2020-08-04 20:56:02
都0202年了怎么还有人按照名字颜色区分强弱啊
by Ex90r @ 2020-08-04 21:22:23
@牛奶小咖啡 比如去年暑假(窝是xxs,欸欸欸不是某种特殊意义上的就是5~12岁的意思QAQ)窝没事干每天刷8~9小时都是卑微蓝名QAQ