結果

問題 No.87 Advent Calendar Problem
ユーザー rlangevin
提出日時 2023-06-20 00:33:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 46 ms / 5,000 ms
コード長 401 bytes
コンパイル時間 241 ms
コンパイル使用メモリ 81,908 KB
実行使用メモリ 60,900 KB
最終ジャッジ日時 2024-06-27 11:46:34
合計ジャッジ時間 2,579 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(n):
    now = 0
    cnt = 0
    for i in range(2015, 2015 + n):
        if i % 400 == 0:
            now += 366 % 7
        elif i % 100 == 0:
            now += 365 % 7
        elif i % 4 == 0:
            now += 366 % 7
        else:
            now += 365 % 7
        now %= 7
        cnt += int(now == 0) 
    return cnt

N = int(input())
N -= 2014
print(f(2800) * (N // 2800) + f(N % 2800))
0