Spoj problem lsort(dynamic programming)

Revision en1, by codolove, 2015-06-30 01:59:16

I am trying to solve this on spoj. I have first precomputed the index for both the case(appending number to beginning and appending number to end). Then, I used top down approach to find the minimum value. It works on most test cases but gives wrong answer on spoj. I am not able to figure out the reason. Please help. My Soloution

Tags dynamic programming, solution spoj, sorting

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English codolove 2015-06-30 01:59:16 440 Initial revision (published)