結果

問題 No.2390 Udon Coupon (Hard)
ユーザー 👑 Mizar
提出日時 2023-06-29 23:47:07
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 500 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 17,696 KB
最終ジャッジ日時 2024-07-19 03:12:06
合計ジャッジ時間 4,195 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 TLE * 1
other AC * 7 -- * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

def co_solve(n, a0, b0, a1, b1, a2, b2):
	return max([
		max([
			(dj // a0) * b0 + i * b1 + j * b2
			for j, dj in zip(range(a0), range(di, 0, -a2))
		])
		for i, di in zip(range(a0), range(n, 0, -a1))
	])

n = int(input())
a0, b0 = (int(x) for x in input().split())
a1, b1 = (int(x) for x in input().split())
a2, b2 = (int(x) for x in input().split())

result = max(
	co_solve(n, a0, b0, a1, b1, a2, b2),
	co_solve(n, a1, b1, a2, b2, a0, b0),
	co_solve(n, a2, b2, a0, b0, a1, b1),
)

print(result)
0