#P2097. 资料分发 1
资料分发 1
Description
There are several computers, and some pairs are connected by bidirectional data lines. If a computer receives the data, then every computer that is reachable from it via the data lines will also receive the data. Now you have the data. What is the minimum number of computers into which you must input the data so that all computers receive it?
Input Format
The first line contains two integers . Here is the number of vertices, and is the number of edges. The next lines each contain two integers , indicating that there is a bidirectional data line between and .
Output Format
Output one integer, the minimum number of computers into which you must input the data.
4 5
1 2
1 3
2 3
2 1
3 4
1
Hint
- For of the testdata, , .
- For of the testdata, .
- For of the testdata, , , .
The graph may contain multiple edges and self-loops.
Translated by ChatGPT 5
京公网安备 11011102002149号