登录
首页 » Windows开发 » CrossTheMaze

CrossTheMaze

于 2022-02-25 发布 文件大小:2.20 kB
0 50
下载积分: 2 下载次数: 1

代码说明:

Assume that Edison has found himself in a square-shaped maze of NxN square cells which is surrounded by walls from the outside. In the maze, some of the cells are also walls. Edison can only move between two empty cells in four directions, north, south, west and east. In order to get out of the maze, he drafts a plan. He uses his left hand to lean on the wall and goes by following the wall. Here is the question, is Edison able to get out of the maze in at most 10,000 steps? If he can make it, output the path. By getting out of the maze, he only needs to be in the exit cell. If the starting cell is the same as the exit, Edison won"t need to move and can directly get out of the maze. Input The first line of the input gives the number of test cases, T. T test cases follow. Each test case starts with an integer N. N is the size of the maze. Th

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 696524资源总数
  • 103939会员总数
  • 12今日下载