結果
| 問題 |
No.2390 Udon Coupon (Hard)
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2023-06-28 19:01:28 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 511 bytes |
| コンパイル時間 | 298 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 16,000 KB |
| 最終ジャッジ日時 | 2024-07-19 03:11:32 |
| 合計ジャッジ時間 | 4,516 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 TLE * 1 |
| other | AC * 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 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)