結果

問題 No.87 Advent Calendar Problem
ユーザー n_knuun_knuu
提出日時 2015-05-14 00:04:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 412 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 10,688 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2023-09-20 07:37:06
合計ジャッジ時間 2,118 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,864 KB
testcase_01 AC 16 ms
7,788 KB
testcase_02 AC 16 ms
7,776 KB
testcase_03 AC 16 ms
7,940 KB
testcase_04 AC 17 ms
7,840 KB
testcase_05 AC 17 ms
7,712 KB
testcase_06 AC 16 ms
7,792 KB
testcase_07 AC 17 ms
7,904 KB
testcase_08 AC 17 ms
7,904 KB
testcase_09 AC 17 ms
7,752 KB
testcase_10 AC 17 ms
7,944 KB
testcase_11 AC 17 ms
7,788 KB
testcase_12 AC 17 ms
7,892 KB
testcase_13 AC 17 ms
7,840 KB
testcase_14 AC 17 ms
7,792 KB
testcase_15 AC 17 ms
7,780 KB
testcase_16 WA -
testcase_17 AC 17 ms
7,788 KB
testcase_18 AC 16 ms
7,948 KB
testcase_19 AC 16 ms
7,736 KB
testcase_20 AC 17 ms
7,796 KB
testcase_21 AC 16 ms
7,788 KB
testcase_22 AC 17 ms
7,776 KB
testcase_23 AC 16 ms
7,796 KB
testcase_24 AC 17 ms
7,856 KB
testcase_25 AC 17 ms
7,844 KB
testcase_26 AC 17 ms
7,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

def isLeap(year):
    if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0:
        return True
    else:
        return False
leap400 = 0
leap400List = []
y = 0
for i in range(2015, 2415):
    if isLeap(i):
        y += 366
    else:
        y += 365
    if y % 7 == 0:
        leap400 += 1
    leap400List.append(leap400)
print(leap400 * ((N-2014) // 400) + leap400List[(N-2014)%400-1])
0