結果
| 問題 |
No.2390 Udon Coupon (Hard)
|
| コンテスト | |
| ユーザー |
cleantted
|
| 提出日時 | 2023-07-03 13:45:58 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 634 bytes |
| コンパイル時間 | 129 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 16,128 KB |
| 最終ジャッジ日時 | 2024-07-19 03:14:17 |
| 合計ジャッジ時間 | 4,270 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 2 TLE * 1 |
| other | RE * 7 -- * 40 |
ソースコード
def co_solve(n, a0, b0, a1, b1, a2, b2):
r = 0
for i in range(min(a0, n // a1 + 1)):
d = n - i * a1
for j in range(a0):
r = max(r, (d // a0) * b0 + i * b1 + j * b2)
d -= a2
if d < 0:
break
return r
def main():
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(
r1 = co_solve(n, a0, b0, a1, b1, a2, b2)
r2 = co_solve(n, a1, b1, a2, b2, a0, b0)
r3 = co_solve(n, a2, b2, a0, b0, a1, b1)
result = max((t1, t2, t3))
print(result)
if __name__ == "__main__":
main()
cleantted