Why this isn't 1-D dp ?

Revision en2, by kaiyu, 2020-05-10 18:13:26

Problem Link:

https://www.codechef.com/problems/GRHARSH

I see all the solutions have 2D dp solution.

I was thinking dp[i] = max gold at the time i.

Is this correct?How to solve it using 1-D dp?

Tags #2d-dp, #dp, 1d-dp, #dynamic programing

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English kaiyu 2020-05-10 18:13:26 130
en1 English kaiyu 2020-05-10 17:39:30 339 Initial revision (published)