#include<bits/stdc++.h>
using namespace std;
struct student{
string s;
int y;
int m;
int d;
int birthday;
};
int main(){
string s; int n,y,m,d;
cin>>n;
vector<student> sI;
student item;
for(int i=0;i<n;i++){
cin>>s>>y>>m>>d;
item.s=s;
item.y=y;
item.m=m;
item.d=d;
item.birthday=d+100*m+10000*y;//这里蒟蒻尝试把年月日转为一串数字方便排序
sI.emplace_back(item);
}
stable_sort(sI.begin(), sI.end(),[](const student& a, const student& b) {
return a.birthday< b.birthday;
});
for (const auto& p : sI)
cout<<p.s<<endl;
return 0;
}
评测记录 deepseek都说我没问题洛谷凭什么说我WA