http://www.usaco.org/index.php?page=viewproblem2&cpid=1157
The editorial suggests that it is possible to use grid DP to solve this but I can’t figure it out. Does anyone know how to do it?
http://www.usaco.org/index.php?page=viewproblem2&cpid=1157
The editorial suggests that it is possible to use grid DP to solve this but I can’t figure it out. Does anyone know how to do it?
dp[row][col][current direction][# direction changes so far]