結果

問題 No.2730 Two Types Luggage
ユーザー 👑 rin204rin204
提出日時 2024-04-20 01:10:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 798 ms / 2,000 ms
コード長 466 bytes
コンパイル時間 817 ms
コンパイル使用メモリ 82,852 KB
実行使用メモリ 266,864 KB
最終ジャッジ日時 2024-04-20 01:10:36
合計ジャッジ時間 14,260 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,240 KB
testcase_01 AC 34 ms
54,288 KB
testcase_02 AC 43 ms
61,464 KB
testcase_03 AC 36 ms
52,740 KB
testcase_04 AC 59 ms
63,744 KB
testcase_05 AC 43 ms
61,804 KB
testcase_06 AC 39 ms
60,872 KB
testcase_07 AC 35 ms
52,964 KB
testcase_08 AC 34 ms
52,696 KB
testcase_09 AC 44 ms
61,464 KB
testcase_10 AC 49 ms
67,072 KB
testcase_11 AC 332 ms
205,928 KB
testcase_12 AC 759 ms
264,444 KB
testcase_13 AC 283 ms
175,300 KB
testcase_14 AC 327 ms
207,548 KB
testcase_15 AC 465 ms
107,472 KB
testcase_16 AC 162 ms
118,512 KB
testcase_17 AC 395 ms
231,812 KB
testcase_18 AC 396 ms
230,896 KB
testcase_19 AC 67 ms
79,072 KB
testcase_20 AC 175 ms
131,984 KB
testcase_21 AC 311 ms
203,720 KB
testcase_22 AC 419 ms
256,572 KB
testcase_23 AC 106 ms
90,320 KB
testcase_24 AC 200 ms
142,472 KB
testcase_25 AC 326 ms
207,676 KB
testcase_26 AC 124 ms
102,076 KB
testcase_27 AC 313 ms
202,960 KB
testcase_28 AC 209 ms
140,748 KB
testcase_29 AC 391 ms
232,476 KB
testcase_30 AC 411 ms
92,256 KB
testcase_31 AC 279 ms
169,072 KB
testcase_32 AC 257 ms
174,588 KB
testcase_33 AC 798 ms
266,056 KB
testcase_34 AC 758 ms
266,864 KB
testcase_35 AC 790 ms
263,948 KB
testcase_36 AC 792 ms
264,204 KB
testcase_37 AC 784 ms
264,040 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 = [0] * (n + 1)
for i in range(n):
    cum[i + 1] = cum[i] + A[i]

ans = 0
for bit in range(1 << m):
    w = 0
    v = 0
    for i in range(m):
        if bit >> i & 1:
            w += B[i]
            v += C[i]
    if w <= W:
        v += cum[min(n, W - w)]
        ans = max(ans, v)
print(ans)
0