結果

問題 No.2730 Two Types Luggage
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2024-04-19 21:41:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 811 ms / 2,000 ms
コード長 509 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 259,452 KB
最終ジャッジ日時 2024-04-19 21:41:37
合計ジャッジ時間 13,772 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
51,712 KB
testcase_01 AC 33 ms
51,840 KB
testcase_02 AC 46 ms
61,184 KB
testcase_03 AC 37 ms
51,840 KB
testcase_04 AC 58 ms
62,848 KB
testcase_05 AC 43 ms
60,544 KB
testcase_06 AC 40 ms
60,160 KB
testcase_07 AC 35 ms
52,096 KB
testcase_08 AC 35 ms
52,352 KB
testcase_09 AC 44 ms
60,672 KB
testcase_10 AC 50 ms
66,284 KB
testcase_11 AC 320 ms
199,560 KB
testcase_12 AC 803 ms
256,740 KB
testcase_13 AC 279 ms
169,620 KB
testcase_14 AC 318 ms
201,812 KB
testcase_15 AC 474 ms
107,228 KB
testcase_16 AC 152 ms
116,092 KB
testcase_17 AC 392 ms
224,560 KB
testcase_18 AC 368 ms
224,040 KB
testcase_19 AC 65 ms
78,604 KB
testcase_20 AC 173 ms
129,512 KB
testcase_21 AC 333 ms
198,548 KB
testcase_22 AC 419 ms
248,628 KB
testcase_23 AC 93 ms
86,688 KB
testcase_24 AC 209 ms
139,572 KB
testcase_25 AC 338 ms
201,368 KB
testcase_26 AC 124 ms
102,596 KB
testcase_27 AC 316 ms
197,568 KB
testcase_28 AC 189 ms
137,272 KB
testcase_29 AC 380 ms
225,860 KB
testcase_30 AC 429 ms
89,452 KB
testcase_31 AC 295 ms
164,748 KB
testcase_32 AC 256 ms
174,848 KB
testcase_33 AC 799 ms
258,248 KB
testcase_34 AC 793 ms
259,452 KB
testcase_35 AC 801 ms
256,576 KB
testcase_36 AC 801 ms
256,828 KB
testcase_37 AC 811 ms
256,324 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()
A.append(0)
A.reverse()

for i in range(len(A)-1):
    A[i+1] += A[i]

ans = 0
for bit in range(2**M):

    nw = 0
    nc = 0
    for i in range(M):
        if (1<<i) & bit:
            nw += B[i]
            nc += C[i]

    #print (nw,nc,A)
    remw = W - nw
    if remw >= 0:
        nc += A[min(remw , len(A)-1)]

        ans = max(ans , nc)

print (ans)
0