結果
| 問題 |
No.2730 Two Types Luggage
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-20 12:52:00 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 430 bytes |
| コンパイル時間 | 179 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 135,180 KB |
| 最終ジャッジ日時 | 2024-10-12 08:15:24 |
| 合計ジャッジ時間 | 8,100 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 TLE * 1 -- * 25 |
ソースコード
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)
cumA=[0 for _ in range(N+1)]
for i in range(N):
cumA[i]=cumA[i-1]+A[i]
ans=0
for i in range(2**M):
w=0;v=0
for j in range(M):
if i>>j&1:w+=B[j];v+=C[j]
if w<W:
dw=min(N,W-w)
w+=dw
v+=cumA[dw-1]
if w<=W:ans=max(ans,v)
print(ans)