问题 1352 --Unrequited Love

1352: Unrequited Love

时间限制: 1 Sec  内存限制: 128 MB
提交: 0  解决: 0
[提交][状态][讨论版][命题人:]

题目描述

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.

输入

   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.

输出

 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.

样例输入

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

来源

 

[提交][状态]