結果

問題 No.2730 Two Types Luggage
ユーザー tkykwtnbtkykwtnb
提出日時 2024-04-20 12:52:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,072 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 266,972 KB
最終ジャッジ日時 2024-04-20 12:53:01
合計ジャッジ時間 19,943 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
52,096 KB
testcase_01 AC 45 ms
51,840 KB
testcase_02 AC 57 ms
61,056 KB
testcase_03 AC 45 ms
52,352 KB
testcase_04 AC 77 ms
62,976 KB
testcase_05 AC 55 ms
60,288 KB
testcase_06 AC 61 ms
59,520 KB
testcase_07 AC 46 ms
52,224 KB
testcase_08 AC 44 ms
51,968 KB
testcase_09 AC 60 ms
60,800 KB
testcase_10 AC 64 ms
67,456 KB
testcase_11 AC 404 ms
206,188 KB
testcase_12 AC 941 ms
264,364 KB
testcase_13 AC 400 ms
174,108 KB
testcase_14 AC 429 ms
207,532 KB
testcase_15 AC 490 ms
107,488 KB
testcase_16 AC 227 ms
118,744 KB
testcase_17 AC 517 ms
231,868 KB
testcase_18 AC 481 ms
231,564 KB
testcase_19 AC 87 ms
79,744 KB
testcase_20 AC 248 ms
132,008 KB
testcase_21 AC 395 ms
203,800 KB
testcase_22 AC 532 ms
256,232 KB
testcase_23 AC 127 ms
90,368 KB
testcase_24 AC 247 ms
142,568 KB
testcase_25 AC 404 ms
207,772 KB
testcase_26 AC 152 ms
102,272 KB
testcase_27 AC 428 ms
202,888 KB
testcase_28 AC 282 ms
140,576 KB
testcase_29 AC 547 ms
232,796 KB
testcase_30 AC 538 ms
92,392 KB
testcase_31 AC 366 ms
169,404 KB
testcase_32 AC 317 ms
174,508 KB
testcase_33 AC 988 ms
266,448 KB
testcase_34 AC 958 ms
266,972 KB
testcase_35 AC 1,072 ms
264,348 KB
testcase_36 AC 946 ms
264,516 KB
testcase_37 AC 914 ms
264,292 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)
cumA=[0 for _ in range(N+1)]
for i in range(N):
    cumA[i]=cumA[i-1]+A[i]
ans=0
for i in range(2**M):
    w=0;v=0
    for j in range(M):
        if i>>j&1:w+=B[j];v+=C[j]
    if w<W:
        dw=min(N,W-w)
        w+=dw
        v+=cumA[dw-1]
    if w<=W:ans=max(ans,v)
print(ans)
0