結果

問題 No.87 Advent Calendar Problem
ユーザー 👑 rin204
提出日時 2022-07-14 13:27:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 53 ms / 5,000 ms
コード長 374 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 56,192 KB
最終ジャッジ日時 2024-06-25 20:39:36
合計ジャッジ時間 2,475 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

import datetime

date = datetime.date(2014, 7, 23)
w = date.weekday()
n = int(input())
z = 0
for y in range(2015, 2415):
    date = datetime.date(y, 7, 23)
    if date.weekday() == w:
        z += 1
ans = (n - 2015) // 400 * z
n = (n - 2015) % 400 + 2015
for y in range(2015, n + 1):
    date = datetime.date(y, 7, 23)
    if date.weekday() == w:
        ans += 1
print(ans)
0