結果
問題 | No.8083 12歳 |
ユーザー |
|
提出日時 | 2023-09-15 18:18:31 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 501 bytes |
コンパイル時間 | 2,915 ms |
コンパイル使用メモリ | 243,696 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-02 20:21:03 |
合計ジャッジ時間 | 9,890 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 366 |
ソースコード
#include <bits/stdc++.h>#define rep(i, n) for (int i = 0; i < (n); i++)using namespace std;bool is_leap(int y) {if (y % 400 == 0) return true;if (y % 100 == 0) return false;return y % 4 == 0;}int main() {int y, n, d;cin >> y >> n >> d;if (d > 333) {if (is_leap(y - 12)) d++;if (is_leap(y + 1)) d--;}int mn = n - min(d, n);int mx = min((is_leap(y - 12) ? 366 : 365) - d, n);cout << mn << " " << mx << endl;return 0;}