結果
問題 | No.2730 Two Types Luggage |
ユーザー |
|
提出日時 | 2024-03-14 17:35:44 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,817 ms / 2,000 ms |
コード長 | 431 bytes |
コンパイル時間 | 328 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 269,316 KB |
最終ジャッジ日時 | 2024-09-29 23:45:14 |
合計ジャッジ時間 | 23,108 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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_ac = [0]for i in A:A_ac.append(A_ac[-1] + i)ans = 0for b in range(1 << M):B_sum = sum(B[i] for i in range(M) if b & (1 << i))C_sum = sum(C[i] for i in range(M) if b & (1 << i))if B_sum <= W:ans = max(ans, A_ac[min(N, W - B_sum)] + C_sum)print(ans)