結果

問題 No.2150 Site Supporter
ユーザー harurunharurun
提出日時 2022-12-07 02:03:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 628 ms / 2,000 ms
コード長 340 bytes
コンパイル時間 321 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 51,556 KB
最終ジャッジ日時 2024-04-21 13:55:48
合計ジャッジ時間 6,675 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,752 KB
testcase_01 AC 25 ms
10,624 KB
testcase_02 AC 25 ms
10,752 KB
testcase_03 AC 25 ms
10,752 KB
testcase_04 AC 25 ms
10,752 KB
testcase_05 AC 26 ms
10,752 KB
testcase_06 AC 27 ms
10,624 KB
testcase_07 AC 27 ms
10,752 KB
testcase_08 AC 106 ms
16,160 KB
testcase_09 AC 538 ms
47,852 KB
testcase_10 AC 290 ms
29,068 KB
testcase_11 AC 561 ms
45,332 KB
testcase_12 AC 217 ms
24,136 KB
testcase_13 AC 126 ms
18,196 KB
testcase_14 AC 26 ms
10,752 KB
testcase_15 AC 25 ms
10,752 KB
testcase_16 AC 26 ms
10,752 KB
testcase_17 AC 628 ms
51,556 KB
testcase_18 AC 247 ms
26,688 KB
testcase_19 AC 93 ms
15,264 KB
testcase_20 AC 414 ms
37,784 KB
testcase_21 AC 66 ms
13,440 KB
testcase_22 AC 588 ms
47,396 KB
testcase_23 AC 28 ms
10,752 KB
testcase_24 AC 27 ms
10,624 KB
testcase_25 AC 27 ms
10,880 KB
testcase_26 AC 27 ms
10,752 KB
testcase_27 AC 351 ms
32,756 KB
testcase_28 AC 321 ms
31,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

inf=10**18
s=0
N,K,X=map(int,input().split())
A=list(map(int,input().split()))
dp=[[inf,inf]for i in range(N+1)]
dp[0][0]=0
dp[0][1]=X
for i in range(N):
  dp[i+1][0]=min(dp[i+1][0],dp[i][0]+A[i])
  dp[i+1][1]=min(dp[i+1][1],dp[i][0]+X+K)
  dp[i+1][0]=min(dp[i+1][0],dp[i][1]+A[i])
  dp[i+1][1]=min(dp[i+1][1],dp[i][1]+K)
print(min(dp[N]))
0