-->
当前位置:首页 > 题库

PROGRAMMING:Judge whether there is a path between two points

Luz5年前 (2021-05-10)题库382
This problem requires the output of whether there is a path between two vertices
###Input format:
The input consists of two parts. The first part is the two vertices corresponding to 1 in the adjacency matrix representation method, which ends with 0
The second part is two vertices, such as VI and VJ
###Output format:
If there are paths for VI and VJ, output 1; Otherwise, output 0
###Input example:
```in
0 1
1 0
0 4
4 0
1 4
4 1
1 2
2 1
1 3
3 1
2 3
3 2
4 5
5 4
4 6
6 4
0 0
0 5
```
###Output example:
```out
one
```







answer:If there is no answer, please comment