시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 512 MB | 66 | 46 | 44 | 73.333% |
You have an undirected graph. Initially, all edges are white. You can choose some edges and paint them black.
After that, while there is a vertex such that exactly one white edge comes out of it, this white edge also becomes black.
Your goal is to choose the minimum possible number of edges to paint black such that, after the process is finished, all edges will be black.
The first line of the input contains two integers n and m: the number of vertices and the number of edges in your graph (1 ≤ n, m ≤ 105).
The next m lines contain description of the edges of the graph. Each of these lines contains two integers ai and bi, describing an edge between vertices ai and bi (1 ≤ ai, bi ≤ n, ai ≠ bi).
It is guaranteed that there are no multiple edges.
Print one integer: the minimum possible number of edges you need to paint black such that, after the end of the described process, all edges will be black.
5 3 3 5 5 1 1 3
1
Camp > Petrozavodsk Programming Camp > Winter 2019 > Day 1: 300iq Contest F번