結果
| 問題 | No.87 Advent Calendar Problem | 
| コンテスト | |
| ユーザー |  lam6er | 
| 提出日時 | 2025-04-16 16:02:04 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 362 bytes | 
| コンパイル時間 | 207 ms | 
| コンパイル使用メモリ | 81,888 KB | 
| 実行使用メモリ | 70,784 KB | 
| 最終ジャッジ日時 | 2025-04-16 16:08:33 | 
| 合計ジャッジ時間 | 12,612 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | -- * 3 | 
| other | TLE * 1 -- * 23 | 
ソースコード
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)
            
            
            
        