In life, there is often a situation in which:
Online shopping, a fixed shopping voucher 1000, there are many goods, the unit price is different, 101,230,330,210,299, ...
How to use the 1000 yuan as much as possible.
This is just an example of a specific conversion into a computer professional description I don't know how to express it,
Question: What number of numbers to approximate a given value (less or equal)
Such a business logic, how to use the algorithm it? Unlimited language. (C,php,java,node)
Reply content:
In life, there is often a situation in which:
Online shopping, a fixed shopping voucher 1000, there are many goods, the unit price is different, 101,230,330,210,299, ...
How to use the 1000 yuan as much as possible.
This is just an example of a specific conversion into a computer professional description I don't know how to express it,
Question: What number of numbers to approximate a given value (less or equal)
Such a business logic, how to use the algorithm it? Unlimited language. (C,php,java,node)
This problem falls into the 背包问题
category and can be solved by it 贪心算法
.
01 knapsack problem
This is typical 01背包问题
, the most common is to 动态规划
solve