help in dp state of zuma , 607b codeforces !

Revision en2, by atlasworld, 2019-01-01 20:25:23

in problem zuma , why do we need a dp state like : as mentioned in tutorial

if(arr[i] == arr[i+1]) dp[i][j] = 1+dp[i+2][j]

i checked by removing this state and it gave WA .

why only these 2 dp states are not enough ! #@

dp[i][j] = 1+dp[i+1][j] and

dp[i][j] = dp[i+1][k-1] + dp[k+1][j]

CAN anyone clarify it more ? ! @

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English atlasworld 2019-01-01 20:25:23 37 Tiny change: '+1][j]\n\n\n\n\n' -> '+1][j]\n\nCAN anyone clarify it more ? ! @ \n\n\n\n\n'
en1 English atlasworld 2019-01-01 20:24:25 445 Initial revision (published)