結果

問題 No.2730 Two Types Luggage
ユーザー anonymously
提出日時 2024-04-19 21:55:38
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 406 bytes
コンパイル時間 695 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 133,032 KB
最終ジャッジ日時 2024-10-11 14:57:01
合計ジャッジ時間 7,562 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 TLE * 1 -- * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,W=map(int,input().split())
A=[int(_) for _ in input().split()]
B=[int(_) for _ in input().split()]
C=[int(_) for _ in input().split()]

A.sort(reverse=True)
S=[0]
for i in range(n):
    S.append(S[-1]+A[i])

V=0
for i in range(1<<m):
    w=sum(B[j] for j in range(m) if i & (1<<j))
    if w<=W:
        v=sum(C[j] for j in range(m) if i & (1<<j))+S[min(W-w,n)]
        if v>V:
            V=v

print(V)
0