Welcome to Yumao′s Blog.
Build The Electric System
Time Limit: 1 Second Memory Limit: 32768 KB
Time Limit: 1 Second Memory Limit: 32768 KB
In last winter, there was a big snow storm in South China. The electric system was damaged seriously. Lots of power lines were broken and lots of villages lost contact with the main power grid. The government wants to reconstruct the electric system as soon as possible. So, as a professional programmer, you are asked to write a program to calculate the minimum cost to reconstruct the power lines to make sure there's at least one way between every two villages.
Input