結果

問題 No.2390 Udon Coupon (Hard)
ユーザー sotanishysotanishy
提出日時 2023-07-21 23:50:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 725 bytes
コンパイル時間 1,075 ms
コンパイル使用メモリ 81,592 KB
実行使用メモリ 66,072 KB
最終ジャッジ日時 2023-10-21 23:49:38
合計ジャッジ時間 5,938 ms
ジャッジサーバーID
(参考情報)
judge15 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,364 KB
testcase_01 AC 39 ms
53,364 KB
testcase_02 AC 48 ms
61,588 KB
testcase_03 AC 48 ms
61,588 KB
testcase_04 AC 49 ms
61,588 KB
testcase_05 AC 39 ms
53,364 KB
testcase_06 AC 39 ms
53,364 KB
testcase_07 AC 38 ms
53,364 KB
testcase_08 AC 38 ms
53,364 KB
testcase_09 AC 98 ms
66,072 KB
testcase_10 AC 48 ms
59,908 KB
testcase_11 AC 38 ms
51,924 KB
testcase_12 AC 38 ms
51,888 KB
testcase_13 AC 48 ms
60,020 KB
testcase_14 AC 48 ms
59,856 KB
testcase_15 AC 38 ms
51,760 KB
testcase_16 AC 39 ms
51,964 KB
testcase_17 AC 48 ms
59,960 KB
testcase_18 AC 49 ms
59,912 KB
testcase_19 AC 48 ms
59,860 KB
testcase_20 AC 39 ms
51,728 KB
testcase_21 WA -
testcase_22 AC 49 ms
60,196 KB
testcase_23 AC 48 ms
60,236 KB
testcase_24 AC 68 ms
62,608 KB
testcase_25 AC 68 ms
62,516 KB
testcase_26 AC 68 ms
62,508 KB
testcase_27 AC 68 ms
62,516 KB
testcase_28 AC 65 ms
62,284 KB
testcase_29 AC 90 ms
64,452 KB
testcase_30 AC 90 ms
63,876 KB
testcase_31 AC 94 ms
64,396 KB
testcase_32 AC 90 ms
64,396 KB
testcase_33 AC 89 ms
64,012 KB
testcase_34 AC 126 ms
64,520 KB
testcase_35 AC 123 ms
64,456 KB
testcase_36 AC 121 ms
64,504 KB
testcase_37 AC 124 ms
64,508 KB
testcase_38 AC 122 ms
64,056 KB
testcase_39 AC 62 ms
62,832 KB
testcase_40 AC 65 ms
63,364 KB
testcase_41 AC 63 ms
62,008 KB
testcase_42 AC 63 ms
62,008 KB
testcase_43 AC 58 ms
62,032 KB
testcase_44 AC 53 ms
61,900 KB
testcase_45 AC 63 ms
62,852 KB
testcase_46 AC 51 ms
60,236 KB
testcase_47 AC 49 ms
59,868 KB
testcase_48 AC 57 ms
62,356 KB
testcase_49 AC 38 ms
51,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N = int(input())
A1, B1 = map(int, input().split())
A2, B2 = map(int, input().split())
A3, B3 = map(int, input().split())
D = 0
for x1 in range(min(A2, A3)+1):
    for x2 in range(min(A1, A3)+1):
        remN = N-A1*x1-A2*x2
        if remN < 0:
            break
        D = max(D, B1*x1+B2*x2+B3*(remN//A3))

for x3 in range(min(A2, A1)+1):
    for x2 in range(min(A1, A3)+1):
        remN = N-A3*x3-A2*x2
        if remN < 0:
            break
        D = max(D, B1*(remN//A1)+B2*x2+B3*x3)

for x3 in range(min(A2, A1)+1):
    for x1 in range(min(A2, A3)+1):
        remN = N-A3*x3-A1*x1
        if remN < 0:
            break
        D = max(D, B1*x1+B2*(remN//A2)+B3*x3)

print(D)
0