結果

問題 No.2730 Two Types Luggage
ユーザー lollipoplollipop
提出日時 2024-04-19 21:54:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 958 ms / 2,000 ms
コード長 510 bytes
コンパイル時間 376 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 268,612 KB
最終ジャッジ日時 2024-04-19 21:54:40
合計ジャッジ時間 15,888 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,096 KB
testcase_01 AC 35 ms
51,968 KB
testcase_02 AC 45 ms
61,056 KB
testcase_03 AC 35 ms
52,096 KB
testcase_04 AC 71 ms
73,216 KB
testcase_05 AC 46 ms
61,440 KB
testcase_06 AC 49 ms
59,776 KB
testcase_07 AC 42 ms
51,968 KB
testcase_08 AC 35 ms
51,968 KB
testcase_09 AC 48 ms
63,360 KB
testcase_10 AC 53 ms
68,864 KB
testcase_11 AC 415 ms
231,784 KB
testcase_12 AC 865 ms
267,172 KB
testcase_13 AC 363 ms
215,320 KB
testcase_14 AC 419 ms
233,072 KB
testcase_15 AC 514 ms
107,520 KB
testcase_16 AC 179 ms
138,020 KB
testcase_17 AC 451 ms
263,032 KB
testcase_18 AC 464 ms
256,292 KB
testcase_19 AC 70 ms
84,992 KB
testcase_20 AC 190 ms
156,668 KB
testcase_21 AC 375 ms
240,784 KB
testcase_22 AC 469 ms
265,840 KB
testcase_23 AC 102 ms
96,384 KB
testcase_24 AC 256 ms
177,076 KB
testcase_25 AC 399 ms
230,332 KB
testcase_26 AC 139 ms
115,228 KB
testcase_27 AC 377 ms
240,016 KB
testcase_28 AC 210 ms
167,996 KB
testcase_29 AC 464 ms
258,568 KB
testcase_30 AC 467 ms
96,768 KB
testcase_31 AC 334 ms
210,236 KB
testcase_32 AC 348 ms
174,496 KB
testcase_33 AC 914 ms
267,464 KB
testcase_34 AC 958 ms
267,968 KB
testcase_35 AC 872 ms
268,612 KB
testcase_36 AC 909 ms
268,100 KB
testcase_37 AC 924 ms
268,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate, product

N, M, W = map(int,input().split())
A = sorted(map(int,input().split()), reverse=True)
B = list(map(int,input().split()))
C = list(map(int,input().split()))

BC = [[b, c] for b, c in zip(B, C)]

acc = [0] + list(accumulate(A))

ans = 0
for bit in product([0, 1], repeat=M):
    w = 0; p = 0
    for i in range(M):
        if bit[i]:
            w += BC[i][0]
            p += BC[i][1]
    if w > W:
        continue
    ans = max(ans, p + acc[min(N, W-w)])

print(ans)
0