最后一个点WA了,下样例确实自己错了,求大佬

P1104 生日

哦,我知道了,应该是靠后的先输出,但怎么改呢?
by Algophitronrhythm_ @ 2023-02-07 20:18:01


i see,我知道了
by Algophitronrhythm_ @ 2023-02-07 20:21:27


这回变成倒数第二个点WA了 [记录](https://www.luogu.com.cn/record/101658263)
by Algophitronrhythm_ @ 2023-02-07 20:23:23


好家伙
by Algophitronrhythm_ @ 2023-02-07 20:35:51


已经A了
by Algophitronrhythm_ @ 2023-02-08 07:53:12


# 最后一个测试点有同年同月同日的 # [博客主页](https://www.ricemoon.cn/) ```cpp #include <bits/stdc++.h> using namespace std; #define LL long long #define endl "\n" const int N = 1e5 + 10; const int M = 110; int n; vector<string> s; int year[N], month[N], day[N]; int cnt = 0; bool cmp(int x, int y) { if (year[x] != year[y]) return year[x] < year[y]; else { if (month[x] != month[y]) return month[x] < month[y]; else { if (day[x] != day[y]) return day[x] < day[y]; else return x > y; } } } void solve() { cin >> n; int a[N]; for (int i = 0; i < n; i ++ ) { string s2; cin >> s2; s.push_back(s2); cin >> year[cnt] >> month[cnt] >> day[cnt]; ++ cnt; } for (int i = 0; i < n; i ++ ) a[i] = i; sort(a, a + n, cmp); for (int i = 0; i < n; i ++ ) { cout << s[a[i]] << endl; } } int main() { ios::sync_with_stdio(false); cin.tie(0); solve(); return 0; } ```
by Roger_Spencer @ 2023-02-19 16:06:08


@[Roger_Spencer](/user/871306) 谢谢,已经a了
by Algophitronrhythm_ @ 2023-02-26 17:18:43


|