Kick Start 2019 Round C
Kick Start 2019 Round C Originally published in Chinese on 2019-05-26; this English edition preserves the original scope and technical context. Wiggle Walk (6pts, 12pts) When moving in an R * C matrix, you can directly skip the grid you have already walked through. The data is guaranteed not to move beyond the given matrix. Solution: Simulation Use a visited array to record the grids that have been visited. If you encounter a grid that you have visited, you will directly skip it and traverse it later. Logically speaking, the time complexity of this method cannot pass the Hidden Test Set, but I don’t know why it passed. ...