#P2820. 局域网
局域网
Description
Now we need to resolve the cycle problem. We will remove some cables so that the network contains no cycles, without changing the connectivity of the original graph's nodes, and the sum of over the removed cables is maximized. Please compute this maximum value.
Input Format
The first line contains two positive integers . The next lines each contain three positive integers , indicating that there is a cable between computers and with smoothness .
Output Format
A single positive integer: the maximum value of .
5 5
1 2 8
1 3 1
1 5 3
2 4 5
3 4 2
8
Hint
Constraints: For all testdata, it is guaranteed that , .
Translated by ChatGPT 5
京公网安备 11011102002149号