Need Help to avoid Wrong Answer on Spoj Problem FPOLICE

Revision en1, by hulk_baba, 2017-08-08 20:58:48

Please go through this problem FPOLICE.I wrote a recursive solution intending to somehow convert it into an iterative one. But my recursive solution gives wrong answer. I applied a simple approach explore a vertex 'idx' and calculate minimum risk and money associated with that 'idx' and 'T'(time) and if some vertex is already visited on that path mark it so I do not have to visit it again. I have written some comments too. Can anybody please help to figure out why this code gives the Wrong answer. Code link here

Tags dynamic programming, spoj

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English hulk_baba 2017-08-08 20:58:48 648 Initial revision (published)