結果
| 問題 | No.3402 [Cherry Anniversary 5] Beyond Zelkova, the 5th year vista seen through the bloom of a cherry bloosom |
| コンテスト | |
| ユーザー |
👑 Kazun
|
| 提出日時 | 2025-12-06 19:49:23 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 61 ms / 2,000 ms |
| コード長 | 1,042 bytes |
| 記録 | |
| コンパイル時間 | 3,094 ms |
| コンパイル使用メモリ | 279,224 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-12-08 23:30:33 |
| 合計ジャッジ時間 | 4,321 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 24 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
/// @brief x から y まで何日間 (両端含める) かを求める.
int calculate_days_between(year_month_day x, year_month_day y) {
return (sys_days(y) - sys_days(x)).count() + 1;
}
int main() {
int ys, ms, ds, ye, me, de;
cin >> ys >> ms >> ds >> ye >> me >> de;
year_month_day keyaki_started_on {year(ys), month(ms), day(ds)};
year_month_day keyaki_ended_on {year(ye), month(me), day(de)};
year_month_day sakura_started_on = sys_days(keyaki_ended_on) + days{1};
int b = calculate_days_between(keyaki_started_on, keyaki_ended_on);
int Q; cin >> Q;
for (int q = 1; q <= Q; q++) {
int y, m, d;
cin >> y >> m >> d;
year_month_day query_date {year(y), month(m), day(d)};
int a = calculate_days_between(sakura_started_on, query_date);
if (a < b) { cout << "Less" << endl; }
if (a == b) { cout << "Same" << endl; }
if (a > b) { cout << "More" << endl; }
}
}
Kazun