結果

問題 No.2730 Two Types Luggage
ユーザー hotate29hotate29
提出日時 2024-04-19 21:41:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 886 ms / 2,000 ms
コード長 487 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 82,224 KB
実行使用メモリ 268,640 KB
最終ジャッジ日時 2024-04-19 21:42:02
合計ジャッジ時間 15,259 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,712 KB
testcase_01 AC 36 ms
51,840 KB
testcase_02 AC 60 ms
60,544 KB
testcase_03 AC 36 ms
51,456 KB
testcase_04 AC 62 ms
62,976 KB
testcase_05 AC 46 ms
60,416 KB
testcase_06 AC 43 ms
59,520 KB
testcase_07 AC 37 ms
51,840 KB
testcase_08 AC 38 ms
52,096 KB
testcase_09 AC 47 ms
60,544 KB
testcase_10 AC 53 ms
68,224 KB
testcase_11 AC 397 ms
253,320 KB
testcase_12 AC 830 ms
266,952 KB
testcase_13 AC 354 ms
211,116 KB
testcase_14 AC 407 ms
254,852 KB
testcase_15 AC 483 ms
107,264 KB
testcase_16 AC 173 ms
135,868 KB
testcase_17 AC 495 ms
263,560 KB
testcase_18 AC 449 ms
257,576 KB
testcase_19 AC 72 ms
84,096 KB
testcase_20 AC 201 ms
154,788 KB
testcase_21 AC 391 ms
251,444 KB
testcase_22 AC 523 ms
265,980 KB
testcase_23 AC 103 ms
95,360 KB
testcase_24 AC 234 ms
168,232 KB
testcase_25 AC 398 ms
254,680 KB
testcase_26 AC 138 ms
113,756 KB
testcase_27 AC 392 ms
250,156 KB
testcase_28 AC 211 ms
162,896 KB
testcase_29 AC 476 ms
255,740 KB
testcase_30 AC 431 ms
96,512 KB
testcase_31 AC 326 ms
206,420 KB
testcase_32 AC 278 ms
174,704 KB
testcase_33 AC 886 ms
267,616 KB
testcase_34 AC 861 ms
268,640 KB
testcase_35 AC 877 ms
268,564 KB
testcase_36 AC 856 ms
268,380 KB
testcase_37 AC 875 ms
268,380 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)
sa = [0]
for ai in a:
    sa.append(sa[-1] + ai)

ans = 0

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

    if weight > w:
        continue

    value += sa[min(w - weight, n)]
    ans = max(ans, value)

print(ans)
0