結果

問題 No.2386 Udon Coupon (Easy)
ユーザー shobonvipshobonvip
提出日時 2023-07-21 21:32:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 230 bytes
コンパイル時間 217 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 66,432 KB
最終ジャッジ日時 2024-09-21 22:49:43
合計ジャッジ時間 3,630 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

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

for i in range(1, n+1):
	for x, y in v:
		if i - x < 0: continue
		dp[i] = max(dp[i], dp[i-x] + y)

print(max(dp))
0