题解
2025-03-23 16:11:56
发布于:江苏
5阅读
0回复
0点赞
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int n;
struct awa{
string name;
long long a,b;
}x[1000005];
bool cmp(awa x,awa y){
if(x.a!=y.a){
return x.a>y.a;
}
else if(x.b!=y.b){
return x.b<y.b;
}
else if(x.name!=y.name){
return x.name>y.name;
}
}
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>x[i].name>>x[i].a>>x[i].b;
}
sort(x+1,x+1+n,cmp);
for(int i=1;i<=n;i++){
cout<<x[i].name<<endl;
}
}
这里空空如也
有帮助,赞一个