Confusion in DP States

Revision en1, by REtoAC2001, 2021-07-13 22:34:01

While writing a recursive solution to the problem https://mirror.codeforces.com/contest/1389/problem/B I didn't take count (which is the number of steps taken till now) into account in the dp states. But now that I think of it ,I wonder why doesn't the dp(recursion) depend on the no of steps left.
Here is the link to my submission :https://mirror.codeforces.com/contest/1389/submission/122378801. Here idx represents the present index we are currently in, check denotes whether the last move was left(1) or right(0) and mleft is count of moves to the left we have taken so far. Can anyone help me understand why is it independent on the no of steps taken/left.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English REtoAC2001 2021-07-13 22:34:01 675 Initial revision (published)