文件名称:wxb3
介绍说明--下载内容均来自于网络,请自行研究使用
天津大学ACM网站题,希望和大家交流一下,学习一下,谢谢!- Robot in Maze(TOJ 2470)——(b3.cpp)
There is a robot trapped in the maze. Now you have to send out some instructions, telling it how to reach its destination.
The maze is an M* N grid. Some of the cells are empty, while others are occupied by the wall. Of course the robot can t move into the wall, and the robot can t move outside the grid too. The robot can only accept three commands: TURN LEFT, TURN RIGHT and GO. The robot may face to North, South, East or West during the movement. When it receive a TURN LEFT command, it will rotate 90 degree to the left. That is, if it faces to east before the command, it will face to north after the TURN LEFT command. The TURN RIGHT command is almost the same, except that the direction is opposite. When receive the GO command, the robot will move 1 unit towards its orientation, unless there is a nonempty cell in front of it.
Please note the robot is always face to north at the beginning, i.e., face to the upper border in the maze map. (The
There is a robot trapped in the maze. Now you have to send out some instructions, telling it how to reach its destination.
The maze is an M* N grid. Some of the cells are empty, while others are occupied by the wall. Of course the robot can t move into the wall, and the robot can t move outside the grid too. The robot can only accept three commands: TURN LEFT, TURN RIGHT and GO. The robot may face to North, South, East or West during the movement. When it receive a TURN LEFT command, it will rotate 90 degree to the left. That is, if it faces to east before the command, it will face to north after the TURN LEFT command. The TURN RIGHT command is almost the same, except that the direction is opposite. When receive the GO command, the robot will move 1 unit towards its orientation, unless there is a nonempty cell in front of it.
Please note the robot is always face to north at the beginning, i.e., face to the upper border in the maze map. (The
(系统自动生成,下载前可以参看下载内容)
下载文件列表
wxb3.exe