1088: Unrequited Love
内存限制:128 MB
时间限制:1 S
标准输入输出
题目类型:传统
评测方式:文本比较
上传者:
提交:2
通过:1
题目描述
There is a boy called Jobson in the New World, and he is secretly in love with a girl. We called the girl Peach Girl. The New World consists of many islands, and
these islands are connected by some bridges. Unfortunately, Jobson and Peach Girl live in different islands. Jobson lives in island s and Peach Girl lives in island e.
Recently the unrequited love festers in Jobson's mind, and he wants to see Peach Girl everyday. Fortunately, there will be an ACM Festival
hosted in island s, and
Jobson knows Peach Girl will come to island s that day. So Jobson decides to wait on certain bridge and express his love to Peach Girl once she passes there. Jobson
doesn't know which bridge Peach Girl will choose, but he thinks that there always exit some bridges where he can always meet Peach Girl.
these islands are connected by some bridges. Unfortunately, Jobson and Peach Girl live in different islands. Jobson lives in island s and Peach Girl lives in island e.
Recently the unrequited love festers in Jobson's mind, and he wants to see Peach Girl everyday. Fortunately, there will be an ACM Festival
hosted in island s, and
Jobson knows Peach Girl will come to island s that day. So Jobson decides to wait on certain bridge and express his love to Peach Girl once she passes there. Jobson
doesn't know which bridge Peach Girl will choose, but he thinks that there always exit some bridges where he can always meet Peach Girl.
输入格式
There are multiple cases. Each case begins with two integers 2 ≤ n ≤ 10 ― the number of islands and 2 ≤ m ≤ 10 ― the number of bridges. Then m lines,
each contains two integers a and b (0 ≤ a, b < n), indicating a bridge connecting island a and island b. Finally there is one line contains two integers s and e (0 ≤ s, e < n),
indicating the island Jobson lives in and the island Peach Girl lives in respectively. The island s and island e are always connected by bridges. There may be more
than one bridge between two islands.
each contains two integers a and b (0 ≤ a, b < n), indicating a bridge connecting island a and island b. Finally there is one line contains two integers s and e (0 ≤ s, e < n),
indicating the island Jobson lives in and the island Peach Girl lives in respectively. The island s and island e are always connected by bridges. There may be more
than one bridge between two islands.
输出格式
Find out the bridges where Jobson can always meet his Peach Girl. For each case, output the number of bridges in the first line, then output the numbers of the
bridges in ascending order in the second line. Bridges are numbered starting from zero, as they are given in the input.
bridges in ascending order in the second line. Bridges are numbered starting from zero, as they are given in the input.
输入样例 复制
3 2
0 1
1 2
0 2
6 7
1 3
0 2
2 0
4 0
1 3
1 5
0 1
2 3
输出样例 复制
2
0 1
1
6