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

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

UPD: SOLVED

Hello .

Problem: https://uva.onlinejudge.org/external/6/p624.pdf

I am trying to solve this Problem from today morning . I got WA for several times. I am trying to solve it using 0-1 Knapsack Technique .

In this problem I need to print the items those I have entered into the Sack. But I have no idea how to do it. To solve this problem I wrote a function named path_print to print the Items. I know the error is in that function . That's why I am getting Wrong Answer .

My Code: http://pastebin.ubuntu.com/22295411/

Now can someone please help me to give an idea about How to print the KnapSack Items according to My code.

It'll be a great favor .

Thanks in Advance .

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

»
8 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

This problem can be solved by backtracking.