1 条题解

  • 0
    @ 2025-10-14 9:14:23
    #include <bits/stdc++.h>
    using namespace std;
    int n;
    struct node {
        string s;
        int y, m, d;
    } a[120];
    bool cmp(node x, node z) {
        if (x.y != z.y)
            return x.y < z.y;
        if (x.m != z.m)
            return x.m < z.m;
        if (x.d != z.d)
            return x.d < z.d;
        return x.s > z.s;
    }
    int main() {
        cin >> n;
        for (int i = 0; i < n; i++) {
            cin >> a[i].s >> a[i].y >> a[i].m >> a[i].d;
        }
        sort(a, a + n, cmp);
        for (int i = 0; i < n; i++) {
            cout << a[i].s << endl;
        }
        return 0;
    }
    
    • 1

    信息

    ID
    1157
    时间
    1000ms
    内存
    256MiB
    难度
    (无)
    标签
    (无)
    递交数
    0
    已通过
    0
    上传者