Introduction - If you have any usage issues, please Google them yourself
Into the knapsack problem: Given a super-increasing sequence and a capacity backpack, and then in the super-increasing sequence selected (only choose one) or do not choose each value, and make the selected value is exactly equal to the capacity of the backpack. Code ideas: from the largest element traverses super increasing sequence for each element, if there is greater than or equal backpack space value of the current element, then placed, and then continue to determine the next element backpack space if the value is less than the current element , it is judged that an element