結果
問題 | No.2730 Two Types Luggage |
ユーザー |
![]() |
提出日時 | 2024-04-19 21:31:01 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 923 ms / 2,000 ms |
コード長 | 482 bytes |
コンパイル時間 | 473 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 270,180 KB |
最終ジャッジ日時 | 2024-10-11 14:07:23 |
合計ジャッジ時間 | 16,562 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 35 |
ソースコード
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()))cum = [0]for i in range(N):cum.append(cum[-1]+A[i])ans = 0for i in range(1<<M):weight = 0value = 0for j in range(M):if 1<<j & i:weight += B[j]value += C[j]if weight <= W:value += cum[min(W-weight, N)]ans = max(ans, value)print(ans)