結果

問題 No.2730 Two Types Luggage
ユーザー titiatitia
提出日時 2024-04-19 21:53:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 873 ms / 2,000 ms
コード長 456 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 82,400 KB
実行使用メモリ 267,396 KB
最終ジャッジ日時 2024-04-19 21:53:55
合計ジャッジ時間 15,337 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,968 KB
testcase_01 AC 36 ms
52,224 KB
testcase_02 AC 45 ms
61,056 KB
testcase_03 AC 36 ms
52,148 KB
testcase_04 AC 64 ms
62,720 KB
testcase_05 AC 45 ms
60,288 KB
testcase_06 AC 42 ms
59,872 KB
testcase_07 AC 36 ms
52,096 KB
testcase_08 AC 36 ms
52,096 KB
testcase_09 AC 48 ms
60,800 KB
testcase_10 AC 53 ms
68,608 KB
testcase_11 AC 397 ms
246,448 KB
testcase_12 AC 833 ms
267,396 KB
testcase_13 AC 325 ms
206,040 KB
testcase_14 AC 419 ms
247,592 KB
testcase_15 AC 468 ms
105,152 KB
testcase_16 AC 179 ms
136,300 KB
testcase_17 AC 464 ms
263,268 KB
testcase_18 AC 458 ms
258,760 KB
testcase_19 AC 74 ms
83,472 KB
testcase_20 AC 203 ms
154,636 KB
testcase_21 AC 388 ms
244,940 KB
testcase_22 AC 492 ms
265,324 KB
testcase_23 AC 102 ms
92,576 KB
testcase_24 AC 251 ms
168,596 KB
testcase_25 AC 389 ms
247,768 KB
testcase_26 AC 137 ms
114,012 KB
testcase_27 AC 379 ms
243,616 KB
testcase_28 AC 212 ms
162,976 KB
testcase_29 AC 460 ms
255,708 KB
testcase_30 AC 443 ms
93,848 KB
testcase_31 AC 333 ms
200,936 KB
testcase_32 AC 272 ms
174,900 KB
testcase_33 AC 860 ms
266,256 KB
testcase_34 AC 871 ms
267,292 KB
testcase_35 AC 856 ms
266,904 KB
testcase_36 AC 873 ms
266,896 KB
testcase_37 AC 841 ms
266,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,M,W=map(int,input().split())

A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

A.sort(reverse=True)
S=[0]
for a in A:
    S.append(S[-1]+a)
ANS=0

for i in range(1<<M):
    w=0
    v=0
    for j in range(M):
        if i & (1<<j) != 0:
            w+=B[j]
            v+=C[j]

    if w<=W:
        v+=S[min(W-w,len(S)-1)]

        ANS=max(ANS,v)

print(ANS)

    
0