結果

問題 No.2309 [Cherry 5th Tune D] 夏の先取り
ユーザー navel_tosnavel_tos
提出日時 2023-05-20 19:30:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,223 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 86,960 KB
実行使用メモリ 76,856 KB
最終ジャッジ日時 2023-08-23 09:50:16
合計ジャッジ時間 11,851 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
76,012 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 208 ms
76,708 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 190 ms
76,652 KB
testcase_08 AC 200 ms
76,504 KB
testcase_09 WA -
testcase_10 AC 175 ms
76,728 KB
testcase_11 AC 194 ms
76,452 KB
testcase_12 AC 180 ms
76,284 KB
testcase_13 WA -
testcase_14 AC 194 ms
76,676 KB
testcase_15 WA -
testcase_16 AC 171 ms
76,480 KB
testcase_17 AC 199 ms
76,200 KB
testcase_18 AC 181 ms
76,208 KB
testcase_19 WA -
testcase_20 AC 168 ms
76,312 KB
testcase_21 AC 199 ms
76,584 KB
testcase_22 WA -
testcase_23 AC 176 ms
76,248 KB
testcase_24 AC 214 ms
76,316 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 197 ms
76,520 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 310 ms
76,492 KB
testcase_32 AC 298 ms
76,456 KB
testcase_33 AC 273 ms
76,380 KB
testcase_34 AC 278 ms
76,540 KB
testcase_35 AC 295 ms
76,404 KB
testcase_36 AC 83 ms
75,648 KB
testcase_37 AC 83 ms
75,564 KB
testcase_38 AC 99 ms
76,220 KB
testcase_39 AC 91 ms
75,680 KB
testcase_40 AC 91 ms
75,556 KB
testcase_41 AC 306 ms
76,480 KB
testcase_42 AC 308 ms
76,656 KB
testcase_43 AC 173 ms
76,288 KB
testcase_44 AC 149 ms
76,148 KB
testcase_45 AC 155 ms
76,096 KB
testcase_46 AC 142 ms
76,276 KB
testcase_47 AC 99 ms
76,072 KB
testcase_48 AC 82 ms
75,740 KB
testcase_49 AC 93 ms
75,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yukicoder389E 夏の先取り

'''
方針は合っていそうなのでやりなおし。
添字ガチャにならないといいね。

base円を既に売り上げた状態で、「Wを一切売らないものとして」最大の売り上げを求める
関数を事前定義しよう。最初からこうすればよかったんだ。
'''
f=lambda:list(map(int,input().split()))

def yukicoder389E(A,B,C,X,Y,Z,base,sold=0):
    for x in range(min(A,B)+1):  #Xセットをx食売るときの最大売上を求める
        cnt=base + X*x; a,b,c=A-x,B-x,C
        if Y>Z:
            y=min(b,c); cnt+=Y*y; b-=y; c-=y
            if min(a,c): cnt+=Z*min(a,c)
        else:
            z=min(a,c); cnt+=Z*z; a-=z; c-=z
            if min(b,c): cnt+=Y*min(b,c)
        sold=max(sold,cnt)
    return sold

for _ in range(int(input())):
    A,B,C=f(); X,Y,Z,W=f(); ans=0; P=min(A,B,C)
    for A,B,C,X,Y,Z in [(A,B,C,X,Y,Z),(B,C,A,Y,Z,X),(C,A,B,Z,X,Y)]:
        if 1: ans=max(ans,yukicoder389E(A,B,C,X,Y,Z,0))
        if P: ans=max(ans,yukicoder389E(A-1,B-1,C-1,X,Y,Z,W))
        if P: ans=max(ans,yukicoder389E(A-P+1,B-P+1,C-P+1,X,Y,Z,W*(P-1)))
        if P: ans=max(ans,yukicoder389E(A-P,B-P,C-P,X,Y,Z,W*P))
    print(ans)
0