結果

問題 No.2730 Two Types Luggage
ユーザー なえしら
提出日時 2024-08-13 23:28:31
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 443 bytes
コンパイル時間 452 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 268,756 KB
最終ジャッジ日時 2024-08-13 23:29:00
合計ジャッジ時間 25,583 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30 TLE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate

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)
A = list(accumulate(A, initial=0))

ans = 0
for S in range(1<<M):
  wgt = sum(b for i, b in enumerate(B) if S>>i&1)
  if wgt > W: continue
  val = sum(c for i, c in enumerate(C) if S>>i&1)
  ans = max(ans, val + A[min(W - wgt, N)])

print(ans)
0