卷別
資料結構與演算法
選擇國立臺灣大學 2025 · 考試 · 第 6 題
考科演算法
(5 points) Consider a knapsack with capacity 17 and five types of items, each with its size and value listed below. All items are available in unlimited quantities and each item can be selected more than once. The goal is to maximize the total value of the items placed in the knapsack. If the maximum value of the knapsack is where and are integers in , what is the value of ?
| item | A | B | C | D | E |
|---|---|---|---|---|---|
| size | 3 | 4 | 7 | 8 | 9 |
| value | 4 | 5 | 10 | 11 | 12 |
- (A)3
- (B)4
- (C)5
- (D)6
- (E)7