Блог пользователя Surge226

Автор Surge226, история, 7 часов назад, По-английски

Hello everyone, I am trying to solve Move and Turn problem on codeforces. Basically, the problem says that "A Robot is standing at origin and can choose any of the 4 directions to move in 1st step, then it should turn $$$90^\circ$$$ either to left or right at every step. Now, given that Robot has made exactly $$$n$$$ steps, then what is the number of unique points robot can be present at?"

I got the solution presented in the editorial but there is a DP solution given in the comments, which I am trying to understand but not able to.

DP solution

If someone can help me in understanding it, I would highly appreciate it.

Теги dp, help
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
6 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

When $$$n$$$ is small, you can draw where robot can be present at, then you may understand it better.