oh no
2026-09-08 20:38:12
发布于:辽宁
2阅读
0回复
0点赞
为什么我写完测试点会变成花园re,wa,ac?
😭😭😭
#include<bits/stdc++.h>
using namespace std;
struct node{
string s;
int a,b;
}a[100010];
bool cmp(node x,node y){
if(x.a!=y.a){
return x.a>y.a;
}
else if(x.b!=y.b){
return x.b<y.a;
}
else{
return x.s>y.s;
}
}
int main(){
int n;
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i].s>>a[i].a>>a[i].b;
}
sort(a+1,a+n+1,cmp);
for(int i=1;i<=n;i++){
cout<<a[i].s<<"\n";
}
return 0;
}
这里空空如也







有帮助,赞一个