結果
| 問題 | No.87 Advent Calendar Problem | 
| コンテスト | |
| ユーザー |  lam6er | 
| 提出日時 | 2025-03-31 17:28:04 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 400 bytes | 
| コンパイル時間 | 269 ms | 
| コンパイル使用メモリ | 82,688 KB | 
| 実行使用メモリ | 67,072 KB | 
| 最終ジャッジ日時 | 2025-03-31 17:28:24 | 
| 合計ジャッジ時間 | 12,771 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | -- * 3 | 
| other | TLE * 1 -- * 23 | 
ソースコード
n = int(input())
def is_leap(y):
    if y % 4 != 0:
        return False
    if y % 100 != 0:
        return True
    return y % 400 == 0
current_day = 0  # 2014's December 21 is Sunday
count = 0
for year in range(2015, n + 1):
    if is_leap(year):
        delta = 2
    else:
        delta = 1
    current_day = (current_day + delta) % 7
    if current_day == 0:
        count += 1
print(count)
            
            
            
        