結果

問題 No.2150 Site Supporter
ユーザー harurunharurun
提出日時 2022-12-07 02:03:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 577 ms / 2,000 ms
コード長 340 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 11,012 KB
実行使用メモリ 48,960 KB
最終ジャッジ日時 2023-08-03 15:46:36
合計ジャッジ時間 6,172 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,908 KB
testcase_01 AC 16 ms
7,968 KB
testcase_02 AC 16 ms
7,772 KB
testcase_03 AC 16 ms
7,996 KB
testcase_04 AC 16 ms
7,844 KB
testcase_05 AC 15 ms
7,924 KB
testcase_06 AC 16 ms
7,884 KB
testcase_07 AC 16 ms
7,844 KB
testcase_08 AC 90 ms
13,772 KB
testcase_09 AC 507 ms
44,904 KB
testcase_10 AC 260 ms
26,564 KB
testcase_11 AC 490 ms
42,668 KB
testcase_12 AC 195 ms
21,492 KB
testcase_13 AC 115 ms
15,604 KB
testcase_14 AC 16 ms
7,972 KB
testcase_15 AC 15 ms
7,888 KB
testcase_16 AC 15 ms
7,912 KB
testcase_17 AC 577 ms
48,960 KB
testcase_18 AC 221 ms
23,916 KB
testcase_19 AC 77 ms
12,512 KB
testcase_20 AC 383 ms
35,176 KB
testcase_21 AC 52 ms
10,776 KB
testcase_22 AC 510 ms
44,980 KB
testcase_23 AC 15 ms
7,824 KB
testcase_24 AC 15 ms
7,864 KB
testcase_25 AC 16 ms
7,768 KB
testcase_26 AC 15 ms
7,856 KB
testcase_27 AC 310 ms
29,900 KB
testcase_28 AC 301 ms
28,828 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