結果

問題 No.2390 Udon Coupon (Hard)
ユーザー 👑 MizarMizar
提出日時 2023-07-20 12:23:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,365 ms / 2,000 ms
コード長 435 bytes
コンパイル時間 127 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-15 20:57:38
合計ジャッジ時間 17,190 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,624 KB
testcase_01 AC 32 ms
10,496 KB
testcase_02 AC 32 ms
10,624 KB
testcase_03 AC 33 ms
10,624 KB
testcase_04 AC 34 ms
10,624 KB
testcase_05 AC 185 ms
10,624 KB
testcase_06 AC 30 ms
10,496 KB
testcase_07 AC 30 ms
10,624 KB
testcase_08 AC 30 ms
10,624 KB
testcase_09 AC 687 ms
10,624 KB
testcase_10 AC 32 ms
10,624 KB
testcase_11 AC 30 ms
10,624 KB
testcase_12 AC 31 ms
10,624 KB
testcase_13 AC 31 ms
10,624 KB
testcase_14 AC 31 ms
10,752 KB
testcase_15 AC 30 ms
10,496 KB
testcase_16 AC 30 ms
10,496 KB
testcase_17 AC 31 ms
10,624 KB
testcase_18 AC 31 ms
10,496 KB
testcase_19 AC 31 ms
10,624 KB
testcase_20 AC 30 ms
10,624 KB
testcase_21 AC 30 ms
10,624 KB
testcase_22 AC 34 ms
10,624 KB
testcase_23 AC 33 ms
10,624 KB
testcase_24 AC 227 ms
10,624 KB
testcase_25 AC 249 ms
10,624 KB
testcase_26 AC 269 ms
10,624 KB
testcase_27 AC 239 ms
10,496 KB
testcase_28 AC 221 ms
10,624 KB
testcase_29 AC 750 ms
10,624 KB
testcase_30 AC 708 ms
10,496 KB
testcase_31 AC 729 ms
10,624 KB
testcase_32 AC 736 ms
10,624 KB
testcase_33 AC 748 ms
10,624 KB
testcase_34 AC 1,365 ms
10,624 KB
testcase_35 AC 1,247 ms
10,624 KB
testcase_36 AC 1,272 ms
10,496 KB
testcase_37 AC 1,274 ms
10,624 KB
testcase_38 AC 1,327 ms
10,624 KB
testcase_39 AC 617 ms
10,624 KB
testcase_40 AC 378 ms
10,624 KB
testcase_41 AC 536 ms
10,496 KB
testcase_42 AC 372 ms
10,496 KB
testcase_43 AC 324 ms
10,624 KB
testcase_44 AC 35 ms
10,496 KB
testcase_45 AC 92 ms
10,624 KB
testcase_46 AC 35 ms
10,624 KB
testcase_47 AC 31 ms
10,624 KB
testcase_48 AC 64 ms
10,624 KB
testcase_49 AC 32 ms
10,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A1, B1 = map(int,input().split())
A2, B2 = map(int,input().split())
A3, B3 = map(int,input().split())
if A2 * B1 < A1 * B2:
    A1, B1, A2, B2 = A2, B2, A1, B1
if A3 * B1 < A1 * B3:
    A1, B1, A3, B3 = A3, B3, A1, B1
print(
    max(
        t // A1 * B1 + p + q
        for p, s in zip(range(0, A1 * B2, B2), range(N, -1, -A2))
        for q, t in zip(range(0, A1 * B3, B3), range(s, -1, -A3))
    )
)
0