Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1544191
  • 博文数量: 327
  • 博客积分: 10000
  • 博客等级: 上将
  • 技术积分: 3556
  • 用 户 组: 普通用户
  • 注册时间: 2005-04-05 21:28
个人简介

东黑布衣,流浪幽燕。 真诚善良,值得信赖。

文章分类

全部博文(327)

我的朋友

分类: BSD

2017-06-24 20:55:36

[Problem]
There is a maze as shown in the diagram below. In the maze in th
e form of a 100*100 matrix, the white background represents the
road while the yellow background represents the wall.

Assuming the upper left corner block to be (0, 0), the horizonta
l direction to be x direction and vertical direction to be y dir
ection, the starting point of the maze is (1. 1) and the arrivin
g point is (13, 13).
 
Create a program to determine if there is a path to reach the ar
riving point from the starting point.
 
In the following example, there is the path.

In the following example, the starting point is (1, 1) and the a
rriving point is (11, 11). Thus, there is no route.




It should be noted that the above example uses 16x16 instead of
100x100 because of the space limitation.
 
[Input]
The first line of the input file provides the test case number.
The test cases are followed in next lines.
Total of 10 test cases are given.
In each test case, 1 refers to the wall, 0 refers to the road, 2
refers to the starting point and 3 refers to the arriving point.
 
 
 
[Output]
The output file outputs the test case number following the ‘#’ s
ymbol. It is followed by a space, 0 or 1 to indicate whether the
arriving point can be reached (1 - yes, 0 – no).












































阅读(1374) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~