結果

問題 No.87 Advent Calendar Problem
ユーザー rlangevinrlangevin
提出日時 2023-06-20 00:33:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 5,000 ms
コード長 401 bytes
コンパイル時間 1,071 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 76,012 KB
最終ジャッジ日時 2023-09-09 19:11:20
合計ジャッジ時間 4,433 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
75,916 KB
testcase_01 AC 79 ms
75,456 KB
testcase_02 AC 78 ms
75,564 KB
testcase_03 AC 78 ms
75,896 KB
testcase_04 AC 79 ms
75,724 KB
testcase_05 AC 80 ms
75,904 KB
testcase_06 AC 79 ms
75,760 KB
testcase_07 AC 80 ms
75,900 KB
testcase_08 AC 79 ms
75,992 KB
testcase_09 AC 80 ms
75,728 KB
testcase_10 AC 79 ms
75,868 KB
testcase_11 AC 80 ms
75,992 KB
testcase_12 AC 79 ms
75,832 KB
testcase_13 AC 79 ms
75,744 KB
testcase_14 AC 79 ms
75,796 KB
testcase_15 AC 77 ms
75,944 KB
testcase_16 AC 79 ms
75,632 KB
testcase_17 AC 79 ms
75,752 KB
testcase_18 AC 79 ms
75,628 KB
testcase_19 AC 79 ms
75,628 KB
testcase_20 AC 78 ms
75,556 KB
testcase_21 AC 77 ms
75,620 KB
testcase_22 AC 78 ms
75,628 KB
testcase_23 AC 80 ms
75,732 KB
testcase_24 AC 77 ms
76,012 KB
testcase_25 AC 77 ms
75,760 KB
testcase_26 AC 79 ms
75,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(n):
    now = 0
    cnt = 0
    for i in range(2015, 2015 + n):
        if i % 400 == 0:
            now += 366 % 7
        elif i % 100 == 0:
            now += 365 % 7
        elif i % 4 == 0:
            now += 366 % 7
        else:
            now += 365 % 7
        now %= 7
        cnt += int(now == 0) 
    return cnt

N = int(input())
N -= 2014
print(f(2800) * (N // 2800) + f(N % 2800))
0