DP Timus OJ , Staircase doubt ...

Revision en1, by senshi2504, 2017-08-10 04:56:50

http://acm.timus.ru/problem.aspx?space=1&num=1017

I have been trying this problem for a while . I have figured out the state to be dp[taken][remaining] where taken tells me the number of blocks i have used till now , and remaining tells me the number of blocks that are left with me . Now base case is trivial , but I am not able to get the transition . Can someone please help me with this . Any help is appreciated :)

Tags dynamic programming, timus, doubt, #dp

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English senshi2504 2017-08-10 04:56:50 458 Initial revision (published)