题解
2024-02-24 21:12:57
发布于:云南
21阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
struct node{
string name;
int id,s;
}a[200005];
bool cmp(node x,node y){
if(x.id != y.id) return x.id > y.id;
else if(x.s != y.s) return x.s < y.s;
else return x.name > y.name;
}
int main(){
int n; cin >> n;
for(int i = 1;i <= n;i++) cin >> a[i].name >> a[i].id >> a[i].s;
sort(a + 1,a + n + 1,cmp);
for(int i = 1;i <= n - 1;i++) cout << a[i].name << endl;
//what's?
cout << a[n].name;
return 0;
}
这里空空如也
有帮助,赞一个