結果

問題 No.2386 Udon Coupon (Easy)
ユーザー hiro1729hiro1729
提出日時 2023-09-01 19:44:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 329 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 10,636 KB
実行使用メモリ 15,988 KB
最終ジャッジ日時 2023-09-01 19:44:56
合計ジャッジ時間 9,383 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,972 KB
testcase_01 AC 17 ms
7,976 KB
testcase_02 AC 17 ms
7,940 KB
testcase_03 AC 17 ms
7,992 KB
testcase_04 AC 16 ms
7,900 KB
testcase_05 AC 16 ms
7,836 KB
testcase_06 AC 16 ms
7,816 KB
testcase_07 AC 329 ms
15,880 KB
testcase_08 AC 15 ms
7,804 KB
testcase_09 AC 15 ms
7,788 KB
testcase_10 AC 90 ms
9,812 KB
testcase_11 AC 48 ms
8,884 KB
testcase_12 AC 247 ms
13,784 KB
testcase_13 AC 307 ms
15,428 KB
testcase_14 AC 272 ms
14,604 KB
testcase_15 AC 311 ms
15,364 KB
testcase_16 AC 246 ms
13,564 KB
testcase_17 AC 290 ms
14,840 KB
testcase_18 AC 128 ms
10,864 KB
testcase_19 AC 37 ms
8,740 KB
testcase_20 AC 223 ms
13,080 KB
testcase_21 AC 301 ms
14,972 KB
testcase_22 AC 174 ms
11,920 KB
testcase_23 AC 157 ms
11,844 KB
testcase_24 AC 64 ms
9,044 KB
testcase_25 AC 202 ms
12,712 KB
testcase_26 AC 285 ms
14,556 KB
testcase_27 AC 326 ms
15,652 KB
testcase_28 AC 158 ms
11,764 KB
testcase_29 AC 99 ms
10,108 KB
testcase_30 AC 34 ms
8,532 KB
testcase_31 AC 154 ms
11,468 KB
testcase_32 AC 40 ms
8,700 KB
testcase_33 AC 328 ms
15,988 KB
testcase_34 AC 172 ms
12,076 KB
testcase_35 AC 236 ms
13,540 KB
testcase_36 AC 317 ms
15,768 KB
testcase_37 AC 251 ms
13,932 KB
testcase_38 AC 195 ms
12,584 KB
testcase_39 AC 133 ms
11,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a, b, c = map(int, input().split())
dp = [0] * (n + 1)
for i in range(n + 1):
	if i >= 3:
		dp[i] = max(dp[i], dp[i - 3] + a)
	if i >= 5:
		dp[i] = max(dp[i], dp[i - 5] + b)
	if i >= 10:
		dp[i] = max(dp[i], dp[i - 10] + c)
print(dp[n])
0