結果

問題 No.87 Advent Calendar Problem
ユーザー 👑 rin204rin204
提出日時 2022-07-14 13:27:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 98 ms / 5,000 ms
コード長 374 bytes
コンパイル時間 581 ms
コンパイル使用メモリ 87,056 KB
実行使用メモリ 76,252 KB
最終ジャッジ日時 2023-09-08 03:29:26
合計ジャッジ時間 4,184 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
76,160 KB
testcase_01 AC 91 ms
76,084 KB
testcase_02 AC 92 ms
76,252 KB
testcase_03 AC 87 ms
71,648 KB
testcase_04 AC 85 ms
71,876 KB
testcase_05 AC 95 ms
76,036 KB
testcase_06 AC 96 ms
76,024 KB
testcase_07 AC 96 ms
76,152 KB
testcase_08 AC 95 ms
75,820 KB
testcase_09 AC 95 ms
76,068 KB
testcase_10 AC 94 ms
76,096 KB
testcase_11 AC 87 ms
71,560 KB
testcase_12 AC 87 ms
71,532 KB
testcase_13 AC 93 ms
76,128 KB
testcase_14 AC 97 ms
76,132 KB
testcase_15 AC 94 ms
76,056 KB
testcase_16 AC 94 ms
76,176 KB
testcase_17 AC 95 ms
76,172 KB
testcase_18 AC 94 ms
76,164 KB
testcase_19 AC 95 ms
76,084 KB
testcase_20 AC 95 ms
76,160 KB
testcase_21 AC 97 ms
75,864 KB
testcase_22 AC 89 ms
71,424 KB
testcase_23 AC 93 ms
76,204 KB
testcase_24 AC 87 ms
71,740 KB
testcase_25 AC 96 ms
75,928 KB
testcase_26 AC 95 ms
75,976 KB
権限があれば一括ダウンロードができます

ソースコード

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