結果

問題 No.2150 Site Supporter
ユーザー ThetaTheta
提出日時 2022-12-07 13:18:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 373 ms / 2,000 ms
コード長 447 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 51,412 KB
最終ジャッジ日時 2024-04-21 21:43:52
合計ジャッジ時間 4,875 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,752 KB
testcase_01 AC 33 ms
10,624 KB
testcase_02 AC 35 ms
10,880 KB
testcase_03 AC 34 ms
10,752 KB
testcase_04 AC 33 ms
10,880 KB
testcase_05 AC 34 ms
10,880 KB
testcase_06 AC 34 ms
10,624 KB
testcase_07 AC 33 ms
10,752 KB
testcase_08 AC 76 ms
16,156 KB
testcase_09 AC 321 ms
47,848 KB
testcase_10 AC 167 ms
28,976 KB
testcase_11 AC 300 ms
45,288 KB
testcase_12 AC 132 ms
24,128 KB
testcase_13 AC 91 ms
18,324 KB
testcase_14 AC 34 ms
10,624 KB
testcase_15 AC 33 ms
10,624 KB
testcase_16 AC 32 ms
10,752 KB
testcase_17 AC 373 ms
51,412 KB
testcase_18 AC 155 ms
26,552 KB
testcase_19 AC 70 ms
15,396 KB
testcase_20 AC 254 ms
37,864 KB
testcase_21 AC 56 ms
13,440 KB
testcase_22 AC 325 ms
47,528 KB
testcase_23 AC 34 ms
10,624 KB
testcase_24 AC 33 ms
10,752 KB
testcase_25 AC 30 ms
10,752 KB
testcase_26 AC 33 ms
10,880 KB
testcase_27 AC 211 ms
32,484 KB
testcase_28 AC 201 ms
31,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import inf


def main():
    N, K, X = map(int, input().split())
    A = list(map(int, input().split()))

    dp_table = [[inf, inf] for _ in range(N+1)]
    dp_table[0][0] = 0

    for day, problem_num in enumerate(A, 1):
        dp_table[day][0] = min(dp_table[day-1]) + problem_num
        dp_table[day][1] = min(dp_table[day-1][0] + X, dp_table[day-1][1]) + K
    
    print(min(dp_table[N]))


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