結果

問題 No.2730 Two Types Luggage
ユーザー rarpipipirarpipipi
提出日時 2024-04-20 08:55:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 837 ms / 2,000 ms
コード長 458 bytes
コンパイル時間 307 ms
コンパイル使用メモリ 82,344 KB
実行使用メモリ 268,340 KB
最終ジャッジ日時 2024-04-20 08:55:53
合計ジャッジ時間 15,664 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,352 KB
testcase_01 AC 38 ms
51,840 KB
testcase_02 AC 47 ms
60,928 KB
testcase_03 AC 40 ms
52,224 KB
testcase_04 AC 64 ms
62,976 KB
testcase_05 AC 49 ms
60,160 KB
testcase_06 AC 45 ms
60,032 KB
testcase_07 AC 41 ms
52,224 KB
testcase_08 AC 39 ms
51,968 KB
testcase_09 AC 46 ms
61,312 KB
testcase_10 AC 63 ms
69,248 KB
testcase_11 AC 448 ms
237,944 KB
testcase_12 AC 804 ms
266,912 KB
testcase_13 AC 340 ms
220,068 KB
testcase_14 AC 384 ms
239,088 KB
testcase_15 AC 451 ms
108,928 KB
testcase_16 AC 176 ms
140,204 KB
testcase_17 AC 557 ms
263,240 KB
testcase_18 AC 442 ms
256,776 KB
testcase_19 AC 74 ms
86,144 KB
testcase_20 AC 200 ms
159,544 KB
testcase_21 AC 406 ms
247,208 KB
testcase_22 AC 480 ms
266,324 KB
testcase_23 AC 109 ms
98,048 KB
testcase_24 AC 255 ms
180,416 KB
testcase_25 AC 414 ms
236,220 KB
testcase_26 AC 150 ms
116,864 KB
testcase_27 AC 378 ms
245,652 KB
testcase_28 AC 224 ms
171,336 KB
testcase_29 AC 464 ms
258,400 KB
testcase_30 AC 433 ms
98,176 KB
testcase_31 AC 316 ms
215,236 KB
testcase_32 AC 265 ms
178,684 KB
testcase_33 AC 811 ms
268,340 KB
testcase_34 AC 809 ms
267,920 KB
testcase_35 AC 817 ms
267,240 KB
testcase_36 AC 837 ms
267,468 KB
testcase_37 AC 822 ms
267,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate
n,m,w=map(int,input().split())
a=sorted(list(map(int,input().split())),reverse=True)
acc=[0]+list(accumulate(a))
b=list(map(int,input().split()))
c=list(map(int,input().split()))

ans=acc[min(n,w)]

for i in range(1,1<<m):
    sum_w=0
    v=0
    for j in range(m):
        if i>>j&1==1:
            sum_w+=b[j]
            v+=c[j]

    if sum_w>w:
        continue
    v+=acc[min((w-sum_w),n)]
    ans=max(ans,v)

print(ans)
0