結果

問題 No.2150 Site Supporter
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2022-12-07 19:23:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 165 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 355 ms
コンパイル使用メモリ 82,172 KB
実行使用メモリ 108,644 KB
最終ジャッジ日時 2024-04-22 01:30:45
合計ジャッジ時間 3,636 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,572 KB
testcase_01 AC 36 ms
52,028 KB
testcase_02 AC 35 ms
52,880 KB
testcase_03 AC 34 ms
52,824 KB
testcase_04 AC 36 ms
53,880 KB
testcase_05 AC 34 ms
52,548 KB
testcase_06 AC 36 ms
52,928 KB
testcase_07 AC 34 ms
52,800 KB
testcase_08 AC 87 ms
80,776 KB
testcase_09 AC 161 ms
108,092 KB
testcase_10 AC 101 ms
95,216 KB
testcase_11 AC 144 ms
102,748 KB
testcase_12 AC 89 ms
89,088 KB
testcase_13 AC 69 ms
82,940 KB
testcase_14 AC 39 ms
53,008 KB
testcase_15 AC 38 ms
52,116 KB
testcase_16 AC 34 ms
53,312 KB
testcase_17 AC 165 ms
108,644 KB
testcase_18 AC 89 ms
91,872 KB
testcase_19 AC 65 ms
79,584 KB
testcase_20 AC 123 ms
99,320 KB
testcase_21 AC 53 ms
72,556 KB
testcase_22 AC 151 ms
104,964 KB
testcase_23 AC 38 ms
52,948 KB
testcase_24 AC 35 ms
52,168 KB
testcase_25 AC 39 ms
52,460 KB
testcase_26 AC 40 ms
52,728 KB
testcase_27 AC 107 ms
96,828 KB
testcase_28 AC 98 ms
96,672 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