結果

問題 No.2150 Site Supporter
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2022-12-07 19:23:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 203 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 87,056 KB
実行使用メモリ 119,100 KB
最終ジャッジ日時 2023-08-04 03:02:09
合計ジャッジ時間 5,853 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,356 KB
testcase_01 AC 70 ms
71,308 KB
testcase_02 AC 76 ms
71,520 KB
testcase_03 AC 70 ms
71,172 KB
testcase_04 AC 72 ms
71,044 KB
testcase_05 AC 72 ms
70,924 KB
testcase_06 AC 75 ms
71,352 KB
testcase_07 AC 74 ms
71,520 KB
testcase_08 AC 109 ms
81,492 KB
testcase_09 AC 193 ms
107,748 KB
testcase_10 AC 127 ms
95,048 KB
testcase_11 AC 172 ms
103,292 KB
testcase_12 AC 119 ms
90,732 KB
testcase_13 AC 99 ms
83,508 KB
testcase_14 AC 71 ms
71,332 KB
testcase_15 AC 71 ms
71,340 KB
testcase_16 AC 71 ms
71,344 KB
testcase_17 AC 203 ms
119,100 KB
testcase_18 AC 121 ms
92,148 KB
testcase_19 AC 92 ms
80,464 KB
testcase_20 AC 150 ms
98,588 KB
testcase_21 AC 83 ms
76,288 KB
testcase_22 AC 192 ms
108,192 KB
testcase_23 AC 73 ms
71,252 KB
testcase_24 AC 72 ms
71,176 KB
testcase_25 AC 72 ms
71,252 KB
testcase_26 AC 71 ms
71,400 KB
testcase_27 AC 144 ms
95,592 KB
testcase_28 AC 141 ms
95,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from sys import stdin

N,K,X = map(int,stdin.readline().split())

A = list(map(int,stdin.readline().split()))

inf = float("inf")
dp = [[inf,inf] for i in range(N+1)]
dp[0] = [0,inf]

for i in range(N):

    dp[i+1][0] = min(dp[i]) + A[i]

    dp[i+1][1] = min( dp[i][0]+K+X , dp[i][1]+K )

print (min(dp[-1]))
0