結果
| 問題 |
No.2730 Two Types Luggage
|
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2024-04-19 21:43:20 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 814 ms / 2,000 ms |
| コード長 | 448 bytes |
| コンパイル時間 | 392 ms |
| コンパイル使用メモリ | 82,396 KB |
| 実行使用メモリ | 267,200 KB |
| 最終ジャッジ日時 | 2024-10-11 14:34:41 |
| 合計ジャッジ時間 | 15,144 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 |
ソースコード
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=[0]+A
for i in range(2,len(A)):
A[i]+=A[i-1]
ans=0
for i in range(2**M):
cost=0
value=0
for j in range(M):
if i&1>0:
cost+=B[j]
value+=C[j]
i>>=1
if cost<=W:
tmp=value+A[min(len(A)-1,W-cost)]
ans=max(ans,tmp)
print(ans)
nikoro256