unification专题

Codeforces Contest 1108 problem F MST Unification —— 构建唯一最小生成树

You are given an undirected weighted connected graph with n vertices and m edges without loops and multiple edges. The i-th edge is ei=(ui,vi,wi); the distance between vertices ui and vi along the ed