結果

問題 No.2730 Two Types Luggage
ユーザー ntudantuda
提出日時 2024-04-20 10:28:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 862 ms / 2,000 ms
コード長 536 bytes
コンパイル時間 241 ms
コンパイル使用メモリ 82,252 KB
実行使用メモリ 267,088 KB
最終ジャッジ日時 2024-04-20 10:29:18
合計ジャッジ時間 14,689 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,968 KB
testcase_01 AC 38 ms
51,840 KB
testcase_02 AC 46 ms
60,800 KB
testcase_03 AC 38 ms
52,096 KB
testcase_04 AC 61 ms
63,104 KB
testcase_05 AC 46 ms
60,160 KB
testcase_06 AC 43 ms
59,392 KB
testcase_07 AC 37 ms
51,968 KB
testcase_08 AC 42 ms
51,968 KB
testcase_09 AC 47 ms
60,672 KB
testcase_10 AC 52 ms
66,560 KB
testcase_11 AC 407 ms
206,072 KB
testcase_12 AC 550 ms
264,236 KB
testcase_13 AC 315 ms
173,856 KB
testcase_14 AC 384 ms
206,840 KB
testcase_15 AC 154 ms
107,392 KB
testcase_16 AC 170 ms
118,316 KB
testcase_17 AC 436 ms
231,876 KB
testcase_18 AC 536 ms
230,568 KB
testcase_19 AC 71 ms
78,976 KB
testcase_20 AC 190 ms
131,632 KB
testcase_21 AC 335 ms
203,424 KB
testcase_22 AC 465 ms
256,412 KB
testcase_23 AC 102 ms
89,856 KB
testcase_24 AC 220 ms
142,268 KB
testcase_25 AC 341 ms
207,180 KB
testcase_26 AC 133 ms
102,400 KB
testcase_27 AC 348 ms
202,516 KB
testcase_28 AC 198 ms
140,560 KB
testcase_29 AC 401 ms
232,840 KB
testcase_30 AC 443 ms
92,288 KB
testcase_31 AC 316 ms
169,412 KB
testcase_32 AC 268 ms
174,728 KB
testcase_33 AC 798 ms
266,564 KB
testcase_34 AC 813 ms
267,088 KB
testcase_35 AC 862 ms
264,140 KB
testcase_36 AC 803 ms
264,392 KB
testcase_37 AC 813 ms
264,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, W = list(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)
AA = [0] * (N + 1)
for i in range(1, N + 1):
    AA[i] = AA[i - 1] + A[i - 1]
ans = 0

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

print(ans)
0