結果

問題 No.2730 Two Types Luggage
ユーザー prd_xxxprd_xxx
提出日時 2024-04-19 21:32:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 841 ms / 2,000 ms
コード長 475 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 82,300 KB
実行使用メモリ 268,544 KB
最終ジャッジ日時 2024-04-19 21:32:36
合計ジャッジ時間 13,884 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,224 KB
testcase_01 AC 45 ms
52,080 KB
testcase_02 AC 42 ms
60,672 KB
testcase_03 AC 33 ms
52,352 KB
testcase_04 AC 81 ms
62,848 KB
testcase_05 AC 42 ms
60,544 KB
testcase_06 AC 39 ms
59,392 KB
testcase_07 AC 35 ms
52,224 KB
testcase_08 AC 34 ms
52,352 KB
testcase_09 AC 43 ms
61,312 KB
testcase_10 AC 53 ms
68,864 KB
testcase_11 AC 371 ms
253,452 KB
testcase_12 AC 497 ms
266,960 KB
testcase_13 AC 300 ms
212,132 KB
testcase_14 AC 367 ms
255,120 KB
testcase_15 AC 153 ms
107,136 KB
testcase_16 AC 173 ms
136,244 KB
testcase_17 AC 444 ms
263,936 KB
testcase_18 AC 416 ms
258,236 KB
testcase_19 AC 69 ms
84,352 KB
testcase_20 AC 189 ms
154,948 KB
testcase_21 AC 356 ms
251,440 KB
testcase_22 AC 459 ms
266,372 KB
testcase_23 AC 100 ms
95,364 KB
testcase_24 AC 217 ms
168,236 KB
testcase_25 AC 377 ms
254,692 KB
testcase_26 AC 137 ms
113,932 KB
testcase_27 AC 357 ms
250,144 KB
testcase_28 AC 204 ms
163,416 KB
testcase_29 AC 422 ms
256,164 KB
testcase_30 AC 468 ms
97,280 KB
testcase_31 AC 383 ms
206,296 KB
testcase_32 AC 256 ms
174,712 KB
testcase_33 AC 819 ms
267,732 KB
testcase_34 AC 830 ms
268,256 KB
testcase_35 AC 811 ms
268,328 KB
testcase_36 AC 841 ms
268,544 KB
testcase_37 AC 830 ms
268,364 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)
cums = [0]
for a in A:
    cums.append(cums[-1] + a)

ans = 0
for b in range(1<<M):
    w = v = 0
    for i in range(M):
        if b&(1<<i):
            w += B[i]
            v += C[i]
            if w > W:
                break
    else:
        rem = min(W - w, N)
        ans = max(ans, cums[rem] + v)
print(ans)
0