結果

問題 No.2150 Site Supporter
ユーザー roarisroaris
提出日時 2022-12-07 01:17:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 298 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 82,436 KB
実行使用メモリ 107,392 KB
最終ジャッジ日時 2024-04-21 13:21:21
合計ジャッジ時間 2,754 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
51,840 KB
testcase_01 AC 30 ms
51,968 KB
testcase_02 AC 30 ms
51,968 KB
testcase_03 AC 29 ms
52,096 KB
testcase_04 AC 29 ms
51,840 KB
testcase_05 AC 30 ms
51,968 KB
testcase_06 AC 32 ms
52,096 KB
testcase_07 AC 30 ms
51,968 KB
testcase_08 AC 42 ms
69,376 KB
testcase_09 AC 87 ms
104,960 KB
testcase_10 AC 72 ms
95,808 KB
testcase_11 AC 85 ms
102,756 KB
testcase_12 AC 53 ms
80,932 KB
testcase_13 AC 46 ms
72,192 KB
testcase_14 AC 30 ms
51,584 KB
testcase_15 AC 29 ms
51,840 KB
testcase_16 AC 29 ms
51,968 KB
testcase_17 AC 89 ms
107,392 KB
testcase_18 AC 70 ms
91,640 KB
testcase_19 AC 46 ms
69,504 KB
testcase_20 AC 76 ms
99,456 KB
testcase_21 AC 44 ms
67,044 KB
testcase_22 AC 84 ms
104,960 KB
testcase_23 AC 31 ms
52,324 KB
testcase_24 AC 30 ms
53,648 KB
testcase_25 AC 30 ms
52,440 KB
testcase_26 AC 29 ms
53,284 KB
testcase_27 AC 75 ms
96,920 KB
testcase_28 AC 74 ms
96,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N, K, X = map(int, input().split())
A = list(map(int, input().split()))
dp = [[10**18]*2 for _ in range(N+1)]
dp[0][0] = 0

for i in range(N):
    dp[i+1][0] = min(dp[i][0]+A[i], dp[i][1]+A[i])
    dp[i+1][1] = min(dp[i][0]+X+K, dp[i][1]+K)

print(min(dp[N]))
0