結果
| 問題 | No.2730 Two Types Luggage |
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2024-04-19 21:43:20 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 535 ms / 2,000 ms |
| + 716µs | |
| コード長 | 448 bytes |
| 記録 | |
| コンパイル時間 | 403 ms |
| コンパイル使用メモリ | 64,988 KB |
| 実行使用メモリ | 189,016 KB |
| 最終ジャッジ日時 | 2026-10-15 22:04:04 |
| 合計ジャッジ時間 | 18,702 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 36 |
ソースコード
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