結果
問題 | No.2730 Two Types Luggage |
ユーザー |
👑 ![]() |
提出日時 | 2024-04-19 21:41:19 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 885 ms / 2,000 ms |
コード長 | 509 bytes |
コンパイル時間 | 2,836 ms |
コンパイル使用メモリ | 82,060 KB |
実行使用メモリ | 259,116 KB |
最終ジャッジ日時 | 2024-10-11 14:29:17 |
合計ジャッジ時間 | 16,301 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()A.append(0)A.reverse()for i in range(len(A)-1):A[i+1] += A[i]ans = 0for bit in range(2**M):nw = 0nc = 0for i in range(M):if (1<<i) & bit:nw += B[i]nc += C[i]#print (nw,nc,A)remw = W - nwif remw >= 0:nc += A[min(remw , len(A)-1)]ans = max(ans , nc)print (ans)