結果

問題 No.87 Advent Calendar Problem
コンテスト
ユーザー ntuda
提出日時 2025-03-22 14:57:21
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 438 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 239 ms
コンパイル使用メモリ 96,192 KB
実行使用メモリ 79,132 KB
最終ジャッジ日時 2026-07-07 20:08:11
合計ジャッジ時間 3,434 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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