今天运势不大好,连坐两题都wa了
求救!!!
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
void YMT(){
pair<int,pair<int,int> > p[333];
int n; cin >> n;
for (int i=1;i <= n;i ++){
int a,b,c; cin >> a >> b >> c;
p[i].fi = a+b+c, p[i].se.fi = a, p[i].se.se = i;
}
sort(p+1,p+n+1);
reverse(p+1,p+n+1);
for (int i=1;i<=5;i++)
cout << p[i].se.se << " " << p[i].fi << endl;
}
int main(){
int T=1;
while(T--) YMT();
return 0;
}