POJ 3434 Terrarium:题目解答源码
2016-09-26 16:25
281 查看
POJ 3434 Terrarium:题目解答源码
A zoology research lab has a terrarium with rare species of snakes.Terrarium is a flat box filled with soil,and has a glass top allowing to watch the snakes.There are trenches in the soil,and snakes constantly move along the trenches.All snakes have diameter
of 1 cm and integer length of no less than 2 cm.
While watching the snakes,the zoologists discovered a pattern in their movement:each snake moves at a speed of 1 cm per second forward,until it encounters either a wall or another snake.Faced an obstacle,snake first tries to turn right,if there is also
obstacle on the right,then it tries to turn left.If there is obstacle on the left also,the snake waits for a second before trying to move again.
程序源码
源代码如下:
点击了解完整源代码!
A zoology research lab has a terrarium with rare species of snakes.Terrarium is a flat box filled with soil,and has a glass top allowing to watch the snakes.There are trenches in the soil,and snakes constantly move along the trenches.All snakes have diameter
of 1 cm and integer length of no less than 2 cm.
While watching the snakes,the zoologists discovered a pattern in their movement:each snake moves at a speed of 1 cm per second forward,until it encounters either a wall or another snake.Faced an obstacle,snake first tries to turn right,if there is also
obstacle on the right,then it tries to turn left.If there is obstacle on the left also,the snake waits for a second before trying to move again.
程序源码
源代码如下:
点击了解完整源代码!
相关文章推荐
- POJ 3434 Terrarium:题目解答源码
- POJ 3434 Terrarium:题目解答源码
- POJ 3597 Polygon Division:题目解答源码
- POJ 3597 Polygon Division:题目解答源码
- HDU 1036 Average is not Fast Enough!:题目解答源码
- HDU 3826 Squarefree number:题目解答源码
- HDU 3826 Squarefree number:题目解答源码
- HDU 3220 Alice’s Cube:题目解答源码
- HDU 3220 Alice’s Cube:题目解答源码
- HDU 1036 Average is not Fast Enough!:题目解答源码
- HDU 3220 Alice’s Cube:题目解答源码
- 2008年5期题目解答
- 求高人帮我解答以下几道题目
- 浙大复试上机题目解答(2)
- 据说是年薪40万人民币的岗位应聘题目(10分钟内解答)
- PHP面试题目及其解答
- 陈跃峰的《两个基础的算法题目》的解答
- 0801算法擂台题目解答
- 浙大复试上机题目解答(3)
- Oracle面试题目及解答