Bridges
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
The undirected graph is given. Find all its bridges.
Input
The first line contains two positive integers n and m (n ≤ 20000, m ≤ 200000) - the number of vertices and edges in a graph respectively. Each of the next m lines contains the description of one edge. The edge number i is described with two positive integers b[i]
, e[i]
(1 ≤ b[i]
, e[i]
≤ n) - the numbers of the vertices it connects.
Output
Print in the first line the number b of bridges in a given graph. Print on the next line b integers - the edge numbers that are bridges, in increasing order. The edges are numbered from one in the order they are given at the input.
Examples
Input #1
Answer #1
Submissions 7K
Acceptance rate 23%