結果

問題 No.2150 Site Supporter
ユーザー ntudantuda
提出日時 2022-12-10 13:11:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 397 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 82,496 KB
実行使用メモリ 108,952 KB
最終ジャッジ日時 2024-04-22 23:45:01
合計ジャッジ時間 2,702 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
52,028 KB
testcase_01 AC 34 ms
53,144 KB
testcase_02 AC 34 ms
52,092 KB
testcase_03 AC 34 ms
52,312 KB
testcase_04 AC 34 ms
53,080 KB
testcase_05 AC 35 ms
53,140 KB
testcase_06 AC 34 ms
52,312 KB
testcase_07 AC 33 ms
52,592 KB
testcase_08 AC 46 ms
70,860 KB
testcase_09 AC 94 ms
106,644 KB
testcase_10 AC 76 ms
96,076 KB
testcase_11 AC 88 ms
104,196 KB
testcase_12 AC 55 ms
81,984 KB
testcase_13 AC 49 ms
73,256 KB
testcase_14 AC 32 ms
53,088 KB
testcase_15 AC 31 ms
53,144 KB
testcase_16 AC 31 ms
52,360 KB
testcase_17 AC 94 ms
108,952 KB
testcase_18 AC 74 ms
92,480 KB
testcase_19 AC 47 ms
71,804 KB
testcase_20 AC 82 ms
100,656 KB
testcase_21 AC 47 ms
68,616 KB
testcase_22 AC 92 ms
106,616 KB
testcase_23 AC 32 ms
53,476 KB
testcase_24 AC 33 ms
52,436 KB
testcase_25 AC 32 ms
52,960 KB
testcase_26 AC 33 ms
53,708 KB
testcase_27 AC 78 ms
97,920 KB
testcase_28 AC 80 ms
98,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K, X = map(int, input().split())
A = list(map(int, input().split()))

dp = [[0] * 2 for _ in range(N + 1)]
dp[N][1] = 10 ** 16
# dp[i][j] i+1日目まで済んで、j:1:会員の場合、0:非会員の場合の最小コスト
for i, a in enumerate(A):
    dp[i][0] = min(dp[i - 1][0] + A[i], dp[i - 1][1] + A[i])
    dp[i][1] = min(dp[i - 1][0] + X + K, dp[i - 1][1] + K)
print(min(dp[N - 1]))
0