結果

問題 No.2730 Two Types Luggage
ユーザー Nikkuniku029Nikkuniku029
提出日時 2024-04-20 06:38:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 979 ms / 2,000 ms
コード長 475 bytes
コンパイル時間 1,370 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 266,324 KB
最終ジャッジ日時 2024-04-20 06:39:21
合計ジャッジ時間 19,038 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,840 KB
testcase_01 AC 36 ms
52,096 KB
testcase_02 AC 47 ms
60,800 KB
testcase_03 AC 35 ms
51,968 KB
testcase_04 AC 67 ms
62,976 KB
testcase_05 AC 50 ms
60,288 KB
testcase_06 AC 47 ms
59,520 KB
testcase_07 AC 37 ms
52,096 KB
testcase_08 AC 41 ms
52,096 KB
testcase_09 AC 47 ms
60,800 KB
testcase_10 AC 67 ms
68,992 KB
testcase_11 AC 504 ms
243,688 KB
testcase_12 AC 979 ms
263,728 KB
testcase_13 AC 348 ms
219,816 KB
testcase_14 AC 389 ms
244,356 KB
testcase_15 AC 440 ms
108,928 KB
testcase_16 AC 197 ms
140,208 KB
testcase_17 AC 479 ms
265,472 KB
testcase_18 AC 439 ms
257,716 KB
testcase_19 AC 95 ms
85,632 KB
testcase_20 AC 228 ms
159,388 KB
testcase_21 AC 419 ms
252,192 KB
testcase_22 AC 466 ms
264,056 KB
testcase_23 AC 99 ms
98,176 KB
testcase_24 AC 248 ms
183,808 KB
testcase_25 AC 376 ms
241,884 KB
testcase_26 AC 129 ms
116,604 KB
testcase_27 AC 374 ms
251,552 KB
testcase_28 AC 207 ms
171,340 KB
testcase_29 AC 435 ms
257,644 KB
testcase_30 AC 410 ms
98,304 KB
testcase_31 AC 309 ms
215,056 KB
testcase_32 AC 288 ms
178,672 KB
testcase_33 AC 801 ms
265,296 KB
testcase_34 AC 810 ms
266,324 KB
testcase_35 AC 806 ms
263,568 KB
testcase_36 AC 908 ms
263,512 KB
testcase_37 AC 805 ms
263,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate

N, M, W = map(int, input().split())
A = sorted(list(map(int, input().split())))[::-1]
B = list(map(int, input().split()))
C = list(map(int, input().split()))
cumA = list(accumulate(A, initial=0))
ans = 0
for i in range(1 << M):
    tmp = 0
    w = 0
    for j in range(M):
        if i & (1 << j):
            w += B[j]
            tmp += C[j]
    if w > W:
        continue
    tmp += cumA[min(W - w, N)]
    ans = max(ans, tmp)
print(ans)
0