結果

問題 No.2730 Two Types Luggage
ユーザー i_takui_taku
提出日時 2024-04-20 15:41:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 847 ms / 2,000 ms
コード長 474 bytes
コンパイル時間 586 ms
コンパイル使用メモリ 82,456 KB
実行使用メモリ 267,100 KB
最終ジャッジ日時 2024-04-20 15:42:08
合計ジャッジ時間 15,470 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,840 KB
testcase_01 AC 37 ms
51,840 KB
testcase_02 AC 46 ms
60,544 KB
testcase_03 AC 41 ms
52,352 KB
testcase_04 AC 72 ms
62,592 KB
testcase_05 AC 46 ms
60,416 KB
testcase_06 AC 43 ms
59,136 KB
testcase_07 AC 37 ms
51,584 KB
testcase_08 AC 45 ms
52,480 KB
testcase_09 AC 47 ms
60,800 KB
testcase_10 AC 52 ms
66,944 KB
testcase_11 AC 348 ms
206,216 KB
testcase_12 AC 847 ms
264,396 KB
testcase_13 AC 292 ms
173,820 KB
testcase_14 AC 344 ms
207,104 KB
testcase_15 AC 482 ms
107,512 KB
testcase_16 AC 160 ms
118,080 KB
testcase_17 AC 418 ms
231,520 KB
testcase_18 AC 429 ms
231,016 KB
testcase_19 AC 70 ms
79,360 KB
testcase_20 AC 188 ms
131,780 KB
testcase_21 AC 336 ms
203,696 KB
testcase_22 AC 458 ms
256,340 KB
testcase_23 AC 122 ms
90,112 KB
testcase_24 AC 206 ms
142,284 KB
testcase_25 AC 343 ms
207,448 KB
testcase_26 AC 128 ms
102,528 KB
testcase_27 AC 343 ms
202,672 KB
testcase_28 AC 223 ms
140,156 KB
testcase_29 AC 412 ms
232,676 KB
testcase_30 AC 436 ms
92,032 KB
testcase_31 AC 308 ms
169,020 KB
testcase_32 AC 267 ms
174,384 KB
testcase_33 AC 828 ms
266,492 KB
testcase_34 AC 834 ms
267,100 KB
testcase_35 AC 843 ms
264,484 KB
testcase_36 AC 820 ms
264,344 KB
testcase_37 AC 837 ms
264,144 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)
cum_sum = [0] * (N + 1)
for i in range(N):
    cum_sum[i + 1] = cum_sum[i] + A[i]

ans = 0
for i in range(1 << M):
    w = v = 0
    for j in range(M):
        if i >> j & 1:
            w += B[j]
            v += C[j]
    if w > W:
        continue
    ans = max(ans, v + cum_sum[min(N, W - w)])
print(ans)
0