結果

問題 No.2730 Two Types Luggage
ユーザー nikoro256nikoro256
提出日時 2024-04-19 21:43:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 882 ms / 2,000 ms
コード長 448 bytes
コンパイル時間 360 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 266,824 KB
最終ジャッジ日時 2024-04-19 21:43:38
合計ジャッジ時間 15,052 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,968 KB
testcase_01 AC 36 ms
51,584 KB
testcase_02 AC 47 ms
61,184 KB
testcase_03 AC 37 ms
51,712 KB
testcase_04 AC 62 ms
63,104 KB
testcase_05 AC 46 ms
60,160 KB
testcase_06 AC 43 ms
59,520 KB
testcase_07 AC 37 ms
52,224 KB
testcase_08 AC 38 ms
52,096 KB
testcase_09 AC 48 ms
60,928 KB
testcase_10 AC 69 ms
66,688 KB
testcase_11 AC 404 ms
205,828 KB
testcase_12 AC 851 ms
264,556 KB
testcase_13 AC 331 ms
174,376 KB
testcase_14 AC 362 ms
207,240 KB
testcase_15 AC 479 ms
107,520 KB
testcase_16 AC 180 ms
118,264 KB
testcase_17 AC 436 ms
231,380 KB
testcase_18 AC 419 ms
230,832 KB
testcase_19 AC 73 ms
78,976 KB
testcase_20 AC 211 ms
131,904 KB
testcase_21 AC 353 ms
203,812 KB
testcase_22 AC 492 ms
255,972 KB
testcase_23 AC 102 ms
87,808 KB
testcase_24 AC 244 ms
142,472 KB
testcase_25 AC 367 ms
207,576 KB
testcase_26 AC 135 ms
102,016 KB
testcase_27 AC 373 ms
202,780 KB
testcase_28 AC 221 ms
140,184 KB
testcase_29 AC 462 ms
233,312 KB
testcase_30 AC 426 ms
90,368 KB
testcase_31 AC 331 ms
169,160 KB
testcase_32 AC 307 ms
174,704 KB
testcase_33 AC 871 ms
266,580 KB
testcase_34 AC 839 ms
266,824 KB
testcase_35 AC 861 ms
264,280 KB
testcase_36 AC 882 ms
263,892 KB
testcase_37 AC 832 ms
263,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
A=[0]+A
for i in range(2,len(A)):
    A[i]+=A[i-1]
ans=0
for i in range(2**M):
    cost=0
    value=0
    for j in range(M):
        if i&1>0:
            cost+=B[j]
            value+=C[j]
        i>>=1
    if cost<=W:
        tmp=value+A[min(len(A)-1,W-cost)]
        ans=max(ans,tmp)
print(ans)
0