結果

問題 No.87 Advent Calendar Problem
ユーザー lam6er
提出日時 2025-04-15 23:15:21
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 362 bytes
コンパイル時間 864 ms
コンパイル使用メモリ 82,212 KB
実行使用メモリ 67,464 KB
最終ジャッジ日時 2025-04-15 23:17:45
合計ジャッジ時間 13,182 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other TLE * 1 -- * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
count = 0
base_leap = (2014 // 4) - (2014 // 100) + (2014 // 400)  # Precomputed for 2014

for y in range(2015, n + 1):
    # Calculate the number of leap years from 2015 to y inclusive
    leap = (y // 4) - (y // 100) + (y // 400) - base_leap
    total_days = (y - 2014) * 365 + leap
    if total_days % 7 == 0:
        count += 1

print(count)
0