結果

問題 No.2730 Two Types Luggage
コンテスト
ユーザー norioc
提出日時 2025-10-23 02:53:39
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 410 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 82,192 KB
実行使用メモリ 273,512 KB
最終ジャッジ日時 2025-10-23 02:53:53
合計ジャッジ時間 13,455 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 TLE * 1 -- * 16
権限があれば一括ダウンロードができます

ソースコード

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)
ans = 0
for i in range(1 << M):
    w = v = 0
    for j in range(M):
        if ~i & (1 << j): continue
        w += B[j]
        v += C[j]
        if w > W: break

    if w <= W:
        v += sum(A[:W-w])
        ans = max(ans, v)

print(ans)
0