. The cost of building a bidirectional road between two cities is the sum of their values. Please calculate the minimum cost of connecting these cities, which means any two cities can reach each other.
There are {n} n cities in Byteland, and the i_{th} i th city has a value a_{i} a i . The cost of building a bidirectional road between two cities is the sum of their values. Please calculate the minimum cost of connecting these cities, which means any two cities can reach each other.
(图片来源网络,侵删)
标签: HBC15929Cities题解