結果

問題 No.3083 One Two
コンテスト
ユーザー gew1fw
提出日時 2025-06-12 20:26:10
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
RE  
実行時間 -
コード長 596 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 222 ms
コンパイル使用メモリ 95,852 KB
実行使用メモリ 91,876 KB
最終ジャッジ日時 2026-07-12 00:31:40
合計ジャッジ時間 3,287 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import datetime

Y, N, D = map(int, input().split())

base_date = datetime.date(Y, 4, 1)
end_date = base_date + datetime.timedelta(days=D)

current_date = base_date + datetime.timedelta(days=1)
k = 0

for _ in range(D):
    year = current_date.year
    month = current_date.month
    day = current_date.day
    try:
        datetime.date(Y - 12, month, day)
        k += 1
    except ValueError:
        pass
    current_date += datetime.timedelta(days=1)

s_max = min(k, N)
min_students = N - s_max

s_min = max(0, N - (365 - k))
max_students = N - s_min

print(f"{min_students} {max_students}")
0