結果

問題 No.1104 オンライン点呼
ユーザー tamatotamato
提出日時 2020-07-03 22:07:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 447 bytes
コンパイル時間 530 ms
コンパイル使用メモリ 82,020 KB
実行使用メモリ 102,404 KB
最終ジャッジ日時 2023-10-17 03:38:55
合計ジャッジ時間 3,619 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 86 ms
95,788 KB
testcase_02 AC 87 ms
97,700 KB
testcase_03 AC 83 ms
102,404 KB
testcase_04 AC 36 ms
53,780 KB
testcase_05 AC 36 ms
53,780 KB
testcase_06 AC 36 ms
53,780 KB
testcase_07 AC 65 ms
87,280 KB
testcase_08 WA -
testcase_09 AC 71 ms
97,952 KB
testcase_10 AC 36 ms
53,780 KB
testcase_11 AC 56 ms
77,316 KB
testcase_12 AC 64 ms
85,380 KB
testcase_13 AC 55 ms
77,192 KB
testcase_14 AC 44 ms
62,244 KB
testcase_15 AC 66 ms
88,212 KB
testcase_16 AC 75 ms
97,464 KB
testcase_17 AC 61 ms
83,644 KB
testcase_18 AC 64 ms
87,908 KB
testcase_19 AC 77 ms
96,772 KB
testcase_20 AC 80 ms
96,920 KB
testcase_21 AC 82 ms
96,936 KB
testcase_22 AC 74 ms
95,148 KB
testcase_23 AC 66 ms
86,192 KB
testcase_24 AC 51 ms
71,676 KB
testcase_25 AC 36 ms
53,780 KB
testcase_26 AC 36 ms
53,780 KB
testcase_27 AC 36 ms
53,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    T = [0] * N
    for i in range(1, N):
        if i == 1:
            T[1] = A[0] + B[1]
        else:
            T[i] = min(T[i-1] + A[i-1] + B[i], T[i-2] + A[i-2] + B[i] + K)
    print(T[-1])


if __name__ == '__main__':
    main()
0