結果

問題 No.2309 [Cherry 5th Tune D] 夏の先取り
ユーザー ニックネームニックネーム
提出日時 2023-05-19 23:47:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 549 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-05-10 07:30:56
合計ジャッジ時間 58,345 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 160 ms
10,624 KB
testcase_01 AC 1,208 ms
10,624 KB
testcase_02 AC 1,024 ms
10,624 KB
testcase_03 AC 924 ms
10,496 KB
testcase_04 AC 823 ms
10,624 KB
testcase_05 AC 1,054 ms
10,496 KB
testcase_06 AC 780 ms
10,752 KB
testcase_07 AC 847 ms
10,624 KB
testcase_08 AC 1,282 ms
10,752 KB
testcase_09 AC 1,199 ms
10,752 KB
testcase_10 AC 958 ms
10,624 KB
testcase_11 AC 1,053 ms
10,624 KB
testcase_12 AC 1,199 ms
10,624 KB
testcase_13 AC 1,183 ms
10,752 KB
testcase_14 AC 1,009 ms
10,624 KB
testcase_15 AC 1,201 ms
10,624 KB
testcase_16 AC 638 ms
10,624 KB
testcase_17 AC 1,336 ms
10,624 KB
testcase_18 AC 1,266 ms
10,496 KB
testcase_19 AC 941 ms
10,624 KB
testcase_20 AC 1,214 ms
10,624 KB
testcase_21 AC 644 ms
10,752 KB
testcase_22 AC 697 ms
10,624 KB
testcase_23 AC 844 ms
10,624 KB
testcase_24 AC 1,180 ms
10,752 KB
testcase_25 AC 1,050 ms
10,624 KB
testcase_26 AC 1,324 ms
10,624 KB
testcase_27 AC 785 ms
10,752 KB
testcase_28 AC 913 ms
10,752 KB
testcase_29 AC 1,282 ms
10,624 KB
testcase_30 AC 1,145 ms
10,624 KB
testcase_31 AC 2,878 ms
10,880 KB
testcase_32 AC 2,875 ms
10,880 KB
testcase_33 AC 2,969 ms
10,880 KB
testcase_34 AC 2,981 ms
10,880 KB
testcase_35 AC 2,887 ms
10,880 KB
testcase_36 AC 45 ms
10,624 KB
testcase_37 AC 25 ms
10,752 KB
testcase_38 AC 40 ms
10,752 KB
testcase_39 AC 31 ms
10,752 KB
testcase_40 AC 29 ms
10,752 KB
testcase_41 AC 2,639 ms
10,880 KB
testcase_42 TLE -
testcase_43 AC 1,214 ms
10,624 KB
testcase_44 AC 939 ms
10,752 KB
testcase_45 AC 995 ms
10,752 KB
testcase_46 AC 835 ms
10,624 KB
testcase_47 AC 346 ms
10,752 KB
testcase_48 AC 116 ms
10,624 KB
testcase_49 AC 626 ms
10,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    a,b,c = map(int,input().split())
    x,y,z,w = map(int,input().split())
    ans = 0
    for i in range(min(a,b)+1):
        ai = a-i; bi = b-i; ci = c
        l = min(ai,bi,ci); j = min(bi-l,ci-l); k = min(ai-l,ci-l)
        if y+z<=w: ans = max(ans,x*i+y*j+z*k+w*l)
        elif z<=y>=w: ans = max(ans,x*i+y*min(bi,ci)+z*min(ai,ci-min(bi,ci)))
        elif y<=z>=w: ans = max(ans,x*i+y*min(bi,ci-min(ai,ci))+z*min(ai,ci))
        else: d = min(ci-j-k-l,l); ans = max(ans,x*i+y*(j+d)+z*(k+d)+w*(l-d))
    print(ans)
0