CF19E.Fairy
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Once upon a time there lived a good fairy A. One day a fine young man B came to her and asked to predict his future. The fairy looked into her magic ball and said that soon the fine young man will meet the most beautiful princess ever and will marry her. Then she drew on a sheet of paper n points and joined some of them with segments, each of the segments starts in some point and ends in some other point. Having drawn that picture, she asked the young man to erase one of the segments from the sheet. Then she tries to colour each point red or blue so, that there is no segment having points of the same colour as its ends. If she manages to do so, the prediction will come true. B wants to meet the most beautiful princess, that's why he asks you to help him. Find all the segments that will help him to meet the princess.
输入格式
The first input line contains two integer numbers: n — amount of the drawn points and m — amount of the drawn segments ( 1<=n<=104,0<=m<=104 ). The following m lines contain the descriptions of the segments. Each description contains two different space-separated integer numbers v , u ( 1<=v<=n,1<=u<=n ) — indexes of the points, joined by this segment. No segment is met in the description twice.
输出格式
In the first line output number k — amount of the segments in the answer. In the second line output k space-separated numbers — indexes of these segments in ascending order. Each index should be output only once. Segments are numbered from 1 in the input order.
输入输出样例
输入#1
4 4 1 2 1 3 2 4 3 4
输出#1
4 1 2 3 4
输入#2
4 5 1 2 2 3 3 4 4 1 1 3
输出#2
1 5