結果

問題 No.2386 Udon Coupon (Easy)
ユーザー 👑 MizarMizar
提出日時 2023-07-04 15:22:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 213 ms / 2,000 ms
コード長 291 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 11,924 KB
実行使用メモリ 17,568 KB
最終ジャッジ日時 2023-10-18 00:37:19
合計ジャッジ時間 6,594 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,068 KB
testcase_01 AC 30 ms
10,068 KB
testcase_02 AC 30 ms
10,076 KB
testcase_03 AC 30 ms
10,068 KB
testcase_04 AC 30 ms
10,068 KB
testcase_05 AC 29 ms
10,068 KB
testcase_06 AC 31 ms
10,076 KB
testcase_07 AC 213 ms
15,192 KB
testcase_08 AC 30 ms
10,068 KB
testcase_09 AC 29 ms
10,068 KB
testcase_10 AC 72 ms
10,968 KB
testcase_11 AC 50 ms
10,724 KB
testcase_12 AC 169 ms
15,720 KB
testcase_13 AC 208 ms
17,568 KB
testcase_14 AC 175 ms
13,344 KB
testcase_15 AC 204 ms
15,456 KB
testcase_16 AC 158 ms
13,872 KB
testcase_17 AC 188 ms
13,608 KB
testcase_18 AC 97 ms
12,024 KB
testcase_19 AC 42 ms
10,344 KB
testcase_20 AC 148 ms
14,928 KB
testcase_21 AC 181 ms
14,664 KB
testcase_22 AC 119 ms
12,024 KB
testcase_23 AC 109 ms
11,760 KB
testcase_24 AC 57 ms
10,448 KB
testcase_25 AC 138 ms
14,664 KB
testcase_26 AC 178 ms
13,344 KB
testcase_27 AC 206 ms
17,568 KB
testcase_28 AC 113 ms
12,552 KB
testcase_29 AC 77 ms
10,968 KB
testcase_30 AC 40 ms
10,292 KB
testcase_31 AC 109 ms
11,760 KB
testcase_32 AC 43 ms
10,360 KB
testcase_33 AC 210 ms
13,872 KB
testcase_34 AC 122 ms
12,816 KB
testcase_35 AC 160 ms
15,456 KB
testcase_36 AC 207 ms
15,456 KB
testcase_37 AC 167 ms
12,816 KB
testcase_38 AC 130 ms
13,080 KB
testcase_39 AC 101 ms
13,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a,b,c = map(int,input().split())
dp = [0] * (n + 1)
v = 0

for i in range(n + 1):
	if i >= 10:
		v = max(v, dp[i - 3] + a, dp[i - 5] + b, dp[i - 10] + c)
	elif i >= 5:
		v = max(v, dp[i - 3] + a, dp[i - 5] + b)
	elif i >= 3:
		v = max(v, dp[i - 3] + a)
	dp[i] = v

print(v)
0