| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 512 MB | 21 | 2 | 2 | 12.500% |
A cactus is a simple undirected connected graph in which every edge belongs to at most one simple cycle.
Now, there is a cactus accepting the following two operations:
Because the second operation is costly, it can only be used at most once. The first operation can be used any number of times in any order.
Find a sequence of operations such that, after all operations in the sequence, the final graph has the least possible number of edges.
The first line of input contains two integers $n$ and $m$, the number of vertices and the number of edges in the initial graph ($1 \le n \le 3 \cdot 10^5$, $n - 1 \le m \le \frac{3(n - 1)}{2}$).
Each of the next $m$ lines contains two integers $u$ and $v$ denoting the endpoints of an edge ($1 \le u, v \le n$). The graph is connected and contains no parallel edges and no self-loops.
On the first line, print two integers $m'$ and $K$, the number of edges left in the final graph and the total number of operations.
Then print $K$ more lines. Each line represents an operation:
1 x".2".If there are several optimal answers, print any one of them.
3 3 1 2 1 3 2 3
0 6 2 1 1 1 5 1 2 1 4 1 3
7 7 1 2 1 3 2 3 2 4 2 5 3 6 3 7
0 14 1 4 1 5 1 6 1 7 2 1 1 1 4 1 5 1 6 1 7 1 9 1 2 1 8 1 3