#Lutece2077. 子丑寅卯辰巳午未申酉戌亥
子丑寅卯辰巳午未申酉戌亥
Migrated from Lutece 2077 子丑寅卯辰巳午未申酉戌亥
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
一个有个点的无向连通图,有条无向边,每条边有边权,请你删除条边,使剩下的条边形成一棵树,求这条边的最小边权和。
Input
第一行两个整数,分别表示点和边的个数。
接下来行,每行三个整数,表示一条由连向的无向边,边权为.
输入保证没有重边和自环。
$(1<=N<=100000,N-1<=M<=min(100000 , \frac{n(n-1)}{2}),1<=u,v<=N,1<=c<=10000)$
Output
求删除的条边的最小边权和。
Samples
4 4
1 2 1
2 3 2
3 4 3
4 1 4
1