In life, there is often a situation: online shopping, a fixed shopping coupon of 1000, there are a lot of goods, the unit price is different, 101,230,330,210,299,... how can we use this 1000 yuan as much as possible. This is just an example. I don't know how to convert it into a computer professional. in my life, there is often a situation like this:
Online shopping, a fixed shopping coupon of 1000, there are many products, the unit price is different, 101,230,330,210,299 ,...
How can we use this 1000 yuan as much as possible.
This is just an example. I don't know how to express it as a computer professional,
Example:The sum of the numbers is close to a given value (less than or equal)
What algorithm should be used for such a business logic? Unlimited language. (C, php, java, node)
Reply content:
In life, there is often such a situation:
Online shopping, a fixed shopping coupon of 1000, there are many products, the unit price is different, 101,230,330,210,299 ,...
How can we use this 1000 yuan as much as possible.
This is just an example. I don't know how to express it as a computer professional,
Example:The sum of the numbers is close to a given value (less than or equal)
What algorithm should be used for such a business logic? Unlimited language. (C, php, java, node)
This problem belongsBackpack problems
Category, applicableGreedy algorithm
.
01 backpack problems
This is typical01 backpack problems
, The most common is to useDynamic planning
Solution