ssavi's blog

By ssavi, history, 8 years ago, In English

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 .

  • Vote: I like it
  • 0
  • Vote: I do not like it

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

This problem can be solved by backtracking.