結果

問題 No.2390 Udon Coupon (Hard)
ユーザー yu_w(ゆ)yu_w(ゆ)
提出日時 2023-07-21 22:48:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 165 ms / 2,000 ms
コード長 418 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 64,000 KB
最終ジャッジ日時 2024-04-15 21:03:00
合計ジャッジ時間 7,697 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
61,568 KB
testcase_01 AC 137 ms
61,568 KB
testcase_02 AC 136 ms
61,952 KB
testcase_03 AC 135 ms
61,696 KB
testcase_04 AC 131 ms
61,440 KB
testcase_05 AC 88 ms
61,696 KB
testcase_06 AC 132 ms
61,568 KB
testcase_07 AC 62 ms
59,520 KB
testcase_08 AC 62 ms
59,648 KB
testcase_09 AC 131 ms
61,440 KB
testcase_10 AC 156 ms
63,232 KB
testcase_11 AC 73 ms
61,568 KB
testcase_12 AC 73 ms
61,696 KB
testcase_13 AC 71 ms
61,824 KB
testcase_14 AC 164 ms
64,000 KB
testcase_15 AC 165 ms
62,848 KB
testcase_16 AC 152 ms
62,720 KB
testcase_17 AC 66 ms
61,568 KB
testcase_18 AC 75 ms
62,208 KB
testcase_19 AC 75 ms
61,696 KB
testcase_20 AC 64 ms
59,648 KB
testcase_21 AC 63 ms
59,520 KB
testcase_22 AC 132 ms
61,184 KB
testcase_23 AC 134 ms
61,312 KB
testcase_24 AC 130 ms
61,440 KB
testcase_25 AC 133 ms
61,696 KB
testcase_26 AC 132 ms
61,568 KB
testcase_27 AC 134 ms
61,440 KB
testcase_28 AC 134 ms
61,952 KB
testcase_29 AC 135 ms
61,440 KB
testcase_30 AC 137 ms
61,440 KB
testcase_31 AC 133 ms
61,568 KB
testcase_32 AC 135 ms
61,696 KB
testcase_33 AC 134 ms
61,440 KB
testcase_34 AC 132 ms
61,568 KB
testcase_35 AC 134 ms
61,568 KB
testcase_36 AC 134 ms
61,440 KB
testcase_37 AC 133 ms
61,824 KB
testcase_38 AC 129 ms
61,696 KB
testcase_39 AC 139 ms
61,184 KB
testcase_40 AC 136 ms
61,440 KB
testcase_41 AC 134 ms
61,312 KB
testcase_42 AC 134 ms
61,568 KB
testcase_43 AC 133 ms
61,184 KB
testcase_44 AC 137 ms
61,312 KB
testcase_45 AC 137 ms
61,568 KB
testcase_46 AC 133 ms
61,312 KB
testcase_47 AC 133 ms
61,952 KB
testcase_48 AC 134 ms
61,824 KB
testcase_49 AC 63 ms
59,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
AB=[list(map(int,input().split())) for _ in range(3)]

ls=[[AB[i][1]/AB[i][0],AB[i][0],AB[i][1]] for i in range(3)]
ls.sort()


ans=0
for i in range(2000):
    inum=ls[0][1]*i
    for j in range(2000):
        jnum=ls[1][1]*j
 
        if N-inum-jnum<0:
            continue
        k=(N-inum-jnum)//ls[2][1]
    
        tmp=i*ls[0][2]+j*ls[1][2]+k*ls[2][2]
        ans=max(ans,tmp)
        
print(ans)
0