結果

問題 No.2730 Two Types Luggage
ユーザー rlangevinrlangevin
提出日時 2024-04-19 21:37:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 871 ms / 2,000 ms
コード長 474 bytes
コンパイル時間 242 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 266,580 KB
最終ジャッジ日時 2024-04-19 21:37:27
合計ジャッジ時間 15,175 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,224 KB
testcase_01 AC 39 ms
51,840 KB
testcase_02 AC 46 ms
60,544 KB
testcase_03 AC 37 ms
52,224 KB
testcase_04 AC 62 ms
62,720 KB
testcase_05 AC 46 ms
59,776 KB
testcase_06 AC 43 ms
59,136 KB
testcase_07 AC 39 ms
51,840 KB
testcase_08 AC 38 ms
51,584 KB
testcase_09 AC 49 ms
60,672 KB
testcase_10 AC 51 ms
66,688 KB
testcase_11 AC 381 ms
205,444 KB
testcase_12 AC 843 ms
263,872 KB
testcase_13 AC 339 ms
173,856 KB
testcase_14 AC 385 ms
207,236 KB
testcase_15 AC 459 ms
106,880 KB
testcase_16 AC 168 ms
117,940 KB
testcase_17 AC 466 ms
231,912 KB
testcase_18 AC 445 ms
230,960 KB
testcase_19 AC 72 ms
78,464 KB
testcase_20 AC 195 ms
131,640 KB
testcase_21 AC 375 ms
203,692 KB
testcase_22 AC 505 ms
255,860 KB
testcase_23 AC 102 ms
89,600 KB
testcase_24 AC 226 ms
142,360 KB
testcase_25 AC 386 ms
207,580 KB
testcase_26 AC 135 ms
102,272 KB
testcase_27 AC 375 ms
202,648 KB
testcase_28 AC 209 ms
140,496 KB
testcase_29 AC 445 ms
232,552 KB
testcase_30 AC 430 ms
92,288 KB
testcase_31 AC 323 ms
168,908 KB
testcase_32 AC 289 ms
174,320 KB
testcase_33 AC 828 ms
266,192 KB
testcase_34 AC 839 ms
266,580 KB
testcase_35 AC 830 ms
264,156 KB
testcase_36 AC 871 ms
264,272 KB
testcase_37 AC 867 ms
263,760 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)
Ac = [0] * (N + 1)
for i in range(N):
    Ac[i + 1] = Ac[i] + A[i]
    
M2 = 1 << M
ans = 0
for s in range(M2):
    b, c = 0, 0
    for i in range(M):
        if (s >> i) & 1:
            b += B[i]
            c += C[i]
    if b > W:
        continue
    ans = max(ans, c + Ac[min(N, W - b)])
    
print(ans)
0