結果

問題 No.2730 Two Types Luggage
ユーザー detteiuudetteiuu
提出日時 2024-04-19 21:31:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 783 ms / 2,000 ms
コード長 482 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 82,104 KB
実行使用メモリ 271,148 KB
最終ジャッジ日時 2024-04-19 21:31:17
合計ジャッジ時間 13,817 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
52,268 KB
testcase_01 AC 34 ms
52,884 KB
testcase_02 AC 46 ms
61,032 KB
testcase_03 AC 36 ms
52,268 KB
testcase_04 AC 57 ms
63,888 KB
testcase_05 AC 41 ms
61,692 KB
testcase_06 AC 42 ms
60,976 KB
testcase_07 AC 34 ms
52,460 KB
testcase_08 AC 34 ms
53,192 KB
testcase_09 AC 42 ms
61,020 KB
testcase_10 AC 47 ms
70,596 KB
testcase_11 AC 370 ms
268,336 KB
testcase_12 AC 749 ms
266,788 KB
testcase_13 AC 300 ms
216,428 KB
testcase_14 AC 354 ms
269,416 KB
testcase_15 AC 467 ms
109,340 KB
testcase_16 AC 165 ms
138,500 KB
testcase_17 AC 415 ms
264,208 KB
testcase_18 AC 382 ms
257,320 KB
testcase_19 AC 66 ms
85,124 KB
testcase_20 AC 182 ms
157,708 KB
testcase_21 AC 351 ms
262,588 KB
testcase_22 AC 431 ms
266,252 KB
testcase_23 AC 99 ms
96,240 KB
testcase_24 AC 209 ms
171,708 KB
testcase_25 AC 348 ms
271,148 KB
testcase_26 AC 134 ms
116,180 KB
testcase_27 AC 347 ms
255,832 KB
testcase_28 AC 197 ms
166,304 KB
testcase_29 AC 383 ms
259,340 KB
testcase_30 AC 418 ms
97,732 KB
testcase_31 AC 291 ms
211,068 KB
testcase_32 AC 256 ms
178,652 KB
testcase_33 AC 761 ms
268,236 KB
testcase_34 AC 757 ms
268,184 KB
testcase_35 AC 783 ms
267,960 KB
testcase_36 AC 765 ms
268,056 KB
testcase_37 AC 775 ms
268,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

cum = [0]
for i in range(N):
    cum.append(cum[-1]+A[i])

ans = 0
for i in range(1<<M):
    weight = 0
    value = 0
    for j in range(M):
        if 1<<j & i:
            weight += B[j]
            value += C[j]
    if weight <= W:
        value += cum[min(W-weight, N)]
        ans = max(ans, value)

print(ans)
0