a6b6c6d6 @ 2024-08-18 21:10:53
#include<bits/stdc++.h>
using namespace std;
struct tp{
string a;
int n,m,o,p;
};
tp s[105];
int main(){
int d;
cin>>d;
for(int i=1;i<=d;i++)s[i].p=i;
for(int i=1;i<=d;i++){
cin>>s[i].a>>s[i].n>>s[i].m>>s[i].o;
}
for(int i=0;i<=d*d;i++){
if(s[i].n<s[i-1].n)swap(s[i].p,s[i-1].p);
else if(s[i].n==s[i-1].n){
if(s[i].m<s[i-1].m)swap(s[i].p,s[i-1].p);
else if(s[i].m==s[i-1].m){
if(s[i].o<=s[i-1].o)swap(s[i].p,s[i-1].p);
}
}
}
for(int i=1;i<=d;i++){
for(int j=1;j<=d;j++){
if(s[j].p==i)cout<<s[j].a<<endl;
}
}
return 0;
}
by a6b6c6d6 @ 2024-08-19 17:51:12
@lanlingxuan OK