Confusion in DP States

Правка en1, от REtoAC2001, 2021-07-13 22:34:01

While writing a recursive solution to the problem https://codeforces.me/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://codeforces.me/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.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский REtoAC2001 2021-07-13 22:34:01 675 Initial revision (published)