結果
| 問題 |
No.2730 Two Types Luggage
|
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2024-08-09 04:55:11 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 1,013 ms / 2,000 ms |
| コード長 | 397 bytes |
| コンパイル時間 | 293 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 266,848 KB |
| 最終ジャッジ日時 | 2024-08-09 04:55:32 |
| 合計ジャッジ時間 | 20,960 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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(1,N+1):
A[i]+=A[i-1]
ans=0
for bit in range(1<<M):
b,c=0,0
for m in range(M):
if bit&1<<m:
b+=B[m]
c+=C[m]
if b>W:
continue
ans=max(ans,c+A[min(N,W-b)])
print(ans)
vwxyz