結果

問題 No.2730 Two Types Luggage
ユーザー nouka28nouka28
提出日時 2024-04-20 09:09:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 921 ms / 2,000 ms
コード長 412 bytes
コンパイル時間 407 ms
コンパイル使用メモリ 82,816 KB
実行使用メモリ 268,648 KB
最終ジャッジ日時 2024-04-20 09:09:30
合計ジャッジ時間 16,521 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,712 KB
testcase_01 AC 35 ms
51,968 KB
testcase_02 AC 45 ms
60,928 KB
testcase_03 AC 41 ms
51,968 KB
testcase_04 AC 66 ms
62,592 KB
testcase_05 AC 52 ms
60,288 KB
testcase_06 AC 45 ms
59,520 KB
testcase_07 AC 37 ms
51,968 KB
testcase_08 AC 36 ms
51,968 KB
testcase_09 AC 48 ms
60,800 KB
testcase_10 AC 55 ms
68,736 KB
testcase_11 AC 441 ms
253,552 KB
testcase_12 AC 823 ms
267,080 KB
testcase_13 AC 361 ms
211,384 KB
testcase_14 AC 403 ms
255,380 KB
testcase_15 AC 450 ms
107,456 KB
testcase_16 AC 198 ms
136,132 KB
testcase_17 AC 469 ms
263,776 KB
testcase_18 AC 443 ms
257,728 KB
testcase_19 AC 73 ms
84,480 KB
testcase_20 AC 229 ms
154,700 KB
testcase_21 AC 409 ms
251,828 KB
testcase_22 AC 525 ms
266,252 KB
testcase_23 AC 108 ms
95,744 KB
testcase_24 AC 255 ms
168,368 KB
testcase_25 AC 466 ms
254,956 KB
testcase_26 AC 143 ms
113,988 KB
testcase_27 AC 406 ms
250,288 KB
testcase_28 AC 218 ms
163,164 KB
testcase_29 AC 438 ms
255,876 KB
testcase_30 AC 431 ms
97,148 KB
testcase_31 AC 321 ms
206,428 KB
testcase_32 AC 275 ms
174,712 KB
testcase_33 AC 921 ms
267,744 KB
testcase_34 AC 819 ms
268,640 KB
testcase_35 AC 793 ms
268,648 KB
testcase_36 AC 832 ms
268,632 KB
testcase_37 AC 801 ms
268,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,w=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
a.reverse()
sm=[0]
for i in a:sm.append(sm[-1]+i)

b=list(map(int,input().split()))
c=list(map(int,input().split()))

ans=0
for S in range(1<<m):
    wsum=0
    vsum=0
    for i in range(m):
        if S>>i&1:
            wsum+=b[i]
            vsum+=c[i]
    if wsum>w:continue
    vsum+=sm[min(n,w-wsum)]
    ans=max(ans,vsum)
print(ans)
0