結果

問題 No.87 Advent Calendar Problem
ユーザー ntuda
提出日時 2025-03-22 14:57:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 438 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 82,852 KB
実行使用メモリ 54,308 KB
最終ジャッジ日時 2025-03-22 14:57:24
合計ジャッジ時間 2,402 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect
N = int(input())
nowy = 2015
dnow = 1
X = []
tmp = 0
while not((nowy - 2014) % 400 == 0 and dnow == 0):
    nowy += 1
    dnow += 1
    if nowy % 400 == 0:
        dnow += 1
    elif nowy % 100 == 0:
        dum = 0
    elif nowy % 4 == 0:
        dnow += 1
    if dnow > 6:
        dnow -= 7
    if dnow == 0:
        X.append(nowy - 2014)
ans = (N-2014) // 400 * 57
ans += bisect(X,(N - 2014) % 400)
print(ans)
0