#Lutece1711. 两眼一闭大力搜(Legendary Version. Vol 1)
两眼一闭大力搜(Legendary Version. Vol 1)
Migrated from Lutece 1711 两眼一闭大力搜(Legendary Version. Vol 1)
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
给一个无向图,有个点,条边
现给出起点和终点,问是否存在一条从起点到终点的合法路径.
一条合法路径必须满足下列条件:
- 所经过的边不能重复
- 路径长度必须为
Input
输入第一行有三个数,,.
接下来行,每行两个整数,表示和之间有一条无向边连接
接下来一行两个整数,表示起点和终点
数据保证:
Output
输出一行表示答案,如果存在则输出,否则输出
Samples
11 10 10
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
1 11
YES
6 5 4
1 2
2 3
3 4
4 5
5 6
1 6
NO
Note
大力搜索一发吗少年
第4组Case为特殊构造,如若TLE,请优化你的玄学算法
Resources
xiper