結果
問題 | No.2730 Two Types Luggage |
ユーザー |
![]() |
提出日時 | 2024-04-19 23:09:53 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 843 ms / 2,000 ms |
コード長 | 411 bytes |
コンパイル時間 | 200 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 266,956 KB |
最終ジャッジ日時 | 2024-10-11 17:24:55 |
合計ジャッジ時間 | 14,696 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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() A.append(0) A = A[::-1] for i in range(N): A[i+1] += A[i] ans = A[min(N,W)] for bit in range(1 << M): w,v = 0,0 for j in range(M): if (bit >> j) & 1: w += B[j] v += C[j] if w > W: continue ans = max(ans,v + A[min(N,W-w)]) print(ans)