文件名称:wxb3
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:104.33kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
天津大学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
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.