Блог пользователя Rian_5900

Автор Rian_5900, история, 7 лет назад, По-английски

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.

  • Проголосовать: нравится
  • +13
  • Проголосовать: не нравится

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

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

»
7 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +4 Проголосовать: не нравится

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