Rian_5900's blog

By Rian_5900, history, 5 years ago, In English

You are given n pairs of integers. You have to find the maximum sum of second elements where the sum of corresponding first elements is less than or equal a certain value. Please help me solve the problem.

  • Vote: I like it
  • +13
  • Vote: I do not like it

| Write comment?
»
5 years ago, # |
  Vote: I like it +9 Vote: I do not like it

if I understand correctly, this is the knapsack problem. You can read here https://en.wikipedia.org/wiki/Knapsack_problem

»
5 years ago, # |
Rev. 2   Vote: I like it +4 Vote: I do not like it

Exactly the same as Volodya22. Its known as Knapsack Problem, its a very famous problem. This link may help you https://www.youtube.com/watch?v=8LusJS5-AGo