結果

問題 No.2309 [Cherry 5th Tune D] 夏の先取り
ユーザー ニックネームニックネーム
提出日時 2023-05-19 23:47:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,962 ms / 3,000 ms
コード長 549 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,920 KB
実行使用メモリ 7,920 KB
最終ジャッジ日時 2023-08-23 01:54:15
合計ジャッジ時間 55,065 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
7,820 KB
testcase_01 AC 1,139 ms
7,760 KB
testcase_02 AC 944 ms
7,696 KB
testcase_03 AC 835 ms
7,888 KB
testcase_04 AC 786 ms
7,700 KB
testcase_05 AC 960 ms
7,788 KB
testcase_06 AC 701 ms
7,744 KB
testcase_07 AC 782 ms
7,844 KB
testcase_08 AC 1,121 ms
7,700 KB
testcase_09 AC 1,139 ms
7,920 KB
testcase_10 AC 896 ms
7,792 KB
testcase_11 AC 949 ms
7,724 KB
testcase_12 AC 1,104 ms
7,844 KB
testcase_13 AC 1,095 ms
7,908 KB
testcase_14 AC 924 ms
7,828 KB
testcase_15 AC 1,143 ms
7,828 KB
testcase_16 AC 582 ms
7,792 KB
testcase_17 AC 1,237 ms
7,736 KB
testcase_18 AC 1,180 ms
7,764 KB
testcase_19 AC 854 ms
7,760 KB
testcase_20 AC 1,121 ms
7,884 KB
testcase_21 AC 554 ms
7,792 KB
testcase_22 AC 637 ms
7,824 KB
testcase_23 AC 784 ms
7,816 KB
testcase_24 AC 1,094 ms
7,720 KB
testcase_25 AC 990 ms
7,828 KB
testcase_26 AC 1,244 ms
7,748 KB
testcase_27 AC 719 ms
7,720 KB
testcase_28 AC 792 ms
7,724 KB
testcase_29 AC 1,156 ms
7,876 KB
testcase_30 AC 1,067 ms
7,836 KB
testcase_31 AC 2,757 ms
7,764 KB
testcase_32 AC 2,808 ms
7,752 KB
testcase_33 AC 2,777 ms
7,816 KB
testcase_34 AC 2,767 ms
7,888 KB
testcase_35 AC 2,722 ms
7,700 KB
testcase_36 AC 34 ms
7,788 KB
testcase_37 AC 16 ms
7,748 KB
testcase_38 AC 29 ms
7,744 KB
testcase_39 AC 21 ms
7,788 KB
testcase_40 AC 20 ms
7,772 KB
testcase_41 AC 2,514 ms
7,788 KB
testcase_42 AC 2,962 ms
7,700 KB
testcase_43 AC 1,115 ms
7,816 KB
testcase_44 AC 862 ms
7,856 KB
testcase_45 AC 924 ms
7,780 KB
testcase_46 AC 772 ms
7,832 KB
testcase_47 AC 312 ms
7,820 KB
testcase_48 AC 95 ms
7,780 KB
testcase_49 AC 575 ms
7,736 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