Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
147641 | C班詹皓杰 | 生日 | C++ | Wrong Answer | 25 | 4 MS | 4948 KB | 591 | 2024-05-18 17:06:08 |
#include<iostream> #include<string> #include<algorithm> using namespace std; struct Person{ string name; int year,month,date; }a[100100]; int main(){ int n; cin>>n; for(int i = 0; i < n; i++){ cin>>a[i].name>>a[i].year>>a[i].month>>a[i].date; } sort(a,a+n,[](Person a,Person b){ if(a.year != b.year){ return a.year < b.year; } else if(a.month != b.month){ return a.month < b.month; } else if(a.date != b.date){ return a.date < b.date; } return false; }); for(int i = 0; i < n; i++){ cout<<a[i].name<<'\n'; } return 0; }