結果
問題 |
No.2730 Two Types Luggage
|
ユーザー |
|
提出日時 | 2024-05-03 21:51:11 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 441 bytes |
コンパイル時間 | 448 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 485,888 KB |
最終ジャッジ日時 | 2024-11-25 02:36:13 |
合計ジャッジ時間 | 51,448 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 16 WA * 7 TLE * 12 |
ソースコード
N, M, W = map(int, input().split()) A = sorted(list(map(int, input().split())), reverse=True) B = list(map(int, input().split())) C = list(map(int, input().split())) ans = 0 for i in range(2**M): lst = [] for j in range(M): if (i >> j) & 1: lst.append(j) w = sum(B[i] for i in lst) v = sum(C[i] for i in lst) if W < w: continue j = 0 while j < N and w + A[j] <= W: w += 1 v += A[j] j += 1 ans = max(ans, v) print(ans)