| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 91908 | sh25_wuyy | 统计生日 | C++ | 通过 | 2 MS | 260 KB | 700 | 2026-06-19 14:54:15 |
#include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; struct Person { string name; int y, m, d; int idx; }; bool cmp(const Person& a, const Person& b) { if (a.y != b.y) return a.y < b.y; if (a.m != b.m) return a.m < b.m; if (a.d != b.d) return a.d < b.d; return a.idx > b.idx; }int main() { int n; cin >> n; vector<Person> people(n); for (int i = 0; i < n; ++i) { cin >> people[i].name >> people[i].y >> people[i].m >> people[i].d; people[i].idx = i; }sort(people.begin(), people.end(), cmp); for (auto& p : people) { cout << p.name << endl; }return 0; }