結果

問題 No.2730 Two Types Luggage
ユーザー june19312june19312
提出日時 2024-04-19 23:31:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,327 ms / 2,000 ms
コード長 737 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 270,240 KB
最終ジャッジ日時 2024-04-19 23:31:52
合計ジャッジ時間 19,188 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,968 KB
testcase_01 AC 35 ms
51,968 KB
testcase_02 AC 49 ms
65,528 KB
testcase_03 AC 35 ms
51,876 KB
testcase_04 AC 97 ms
75,768 KB
testcase_05 AC 57 ms
75,776 KB
testcase_06 AC 43 ms
61,440 KB
testcase_07 AC 36 ms
52,132 KB
testcase_08 AC 38 ms
52,224 KB
testcase_09 AC 65 ms
75,776 KB
testcase_10 AC 50 ms
69,632 KB
testcase_11 AC 367 ms
267,600 KB
testcase_12 AC 1,292 ms
267,136 KB
testcase_13 AC 296 ms
215,284 KB
testcase_14 AC 387 ms
268,116 KB
testcase_15 AC 982 ms
107,668 KB
testcase_16 AC 181 ms
140,856 KB
testcase_17 AC 426 ms
262,928 KB
testcase_18 AC 397 ms
257,220 KB
testcase_19 AC 69 ms
84,904 KB
testcase_20 AC 194 ms
157,188 KB
testcase_21 AC 369 ms
255,864 KB
testcase_22 AC 436 ms
265,932 KB
testcase_23 AC 134 ms
95,568 KB
testcase_24 AC 241 ms
183,928 KB
testcase_25 AC 373 ms
270,240 KB
testcase_26 AC 134 ms
115,380 KB
testcase_27 AC 359 ms
266,436 KB
testcase_28 AC 205 ms
168,928 KB
testcase_29 AC 421 ms
259,108 KB
testcase_30 AC 949 ms
95,508 KB
testcase_31 AC 320 ms
210,328 KB
testcase_32 AC 252 ms
174,412 KB
testcase_33 AC 1,307 ms
267,468 KB
testcase_34 AC 1,327 ms
268,132 KB
testcase_35 AC 1,304 ms
268,352 KB
testcase_36 AC 1,304 ms
268,060 KB
testcase_37 AC 1,291 ms
268,096 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.reverse()
rui = []
for i,v in enumerate(A):
    if i == 0:
        rui.append(v)
    else:
        rui.append(rui[-1]+v)

rui = [0] + rui

all = 2**M
alllen = (all-1).bit_length()
ans = 0

for i in range(all):
    nex = bin(i)[2:].zfill(alllen)
    tmpvalue = 0
    tmpomosa = 0
    for ii,vv in enumerate(nex):
        if vv == "1":
            tmpvalue += C[ii]
            tmpomosa += B[ii]
    if tmpomosa > W:
        continue
    nokori = W-tmpomosa
    if nokori >= N:
        tmpvalue += rui[-1]
    else:
        tmpvalue += rui[nokori]
    ans = max(ans,tmpvalue)
print(ans)


0