mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-24 02:21:30 +08:00
build
This commit is contained in:
@@ -428,12 +428,10 @@ comments: true
|
||||
|
||||
```c title="fractional_knapsack.c"
|
||||
/* 物品 */
|
||||
struct Item {
|
||||
typedef struct {
|
||||
int w; // 物品重量
|
||||
int v; // 物品价值
|
||||
};
|
||||
|
||||
typedef struct Item Item;
|
||||
} Item;
|
||||
|
||||
/* 分数背包:贪心 */
|
||||
float fractionalKnapsack(int wgt[], int val[], int itemCount, int cap) {
|
||||
|
||||
Reference in New Issue
Block a user