結果

問題 No.2390 Udon Coupon (Hard)
ユーザー titiatitia
提出日時 2023-11-20 02:53:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 470 bytes
コンパイル時間 401 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 62,240 KB
最終ジャッジ日時 2023-11-20 02:53:54
合計ジャッジ時間 4,348 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 38 ms
53,460 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 36 ms
53,460 KB
testcase_07 AC 36 ms
53,460 KB
testcase_08 AC 37 ms
53,460 KB
testcase_09 AC 43 ms
60,088 KB
testcase_10 WA -
testcase_11 AC 37 ms
53,460 KB
testcase_12 AC 37 ms
53,460 KB
testcase_13 AC 36 ms
53,460 KB
testcase_14 AC 36 ms
53,460 KB
testcase_15 AC 36 ms
53,460 KB
testcase_16 AC 36 ms
53,460 KB
testcase_17 AC 37 ms
53,460 KB
testcase_18 AC 37 ms
53,460 KB
testcase_19 AC 37 ms
53,460 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 36 ms
53,460 KB
testcase_24 AC 44 ms
60,088 KB
testcase_25 AC 44 ms
60,088 KB
testcase_26 AC 43 ms
60,088 KB
testcase_27 AC 44 ms
60,088 KB
testcase_28 WA -
testcase_29 AC 43 ms
60,088 KB
testcase_30 WA -
testcase_31 AC 43 ms
60,088 KB
testcase_32 AC 43 ms
60,088 KB
testcase_33 WA -
testcase_34 AC 45 ms
62,240 KB
testcase_35 AC 43 ms
60,088 KB
testcase_36 AC 46 ms
60,088 KB
testcase_37 AC 45 ms
62,240 KB
testcase_38 WA -
testcase_39 AC 47 ms
62,240 KB
testcase_40 WA -
testcase_41 AC 44 ms
60,088 KB
testcase_42 AC 43 ms
60,088 KB
testcase_43 WA -
testcase_44 AC 43 ms
60,088 KB
testcase_45 AC 42 ms
60,088 KB
testcase_46 WA -
testcase_47 AC 45 ms
62,240 KB
testcase_48 AC 45 ms
62,240 KB
testcase_49 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

AB.sort(reverse=True)

X=[AB[i][1]/AB[i][0] for i in range(3)]

MAX=max(X)
ind=X.index(MAX)

a,b=AB[ind]
xx=AB[0][0]*AB[1][0]*2

k=max(0,N-xx)//a

ANS=k*b
N-=k*a

ANS2=0
for i in range(N//AB[0][0]+1):
    rest=N-i*AB[0][0]

    for j in range(rest//AB[0][1]+1):
        ANS2=max(ANS2,i*AB[0][1]+j*AB[1][1]+(rest-j*AB[1][0])//AB[2][0]*AB[2][1])

print(ANS+ANS2)
0