[题目链接] https://www.lydsy.com/JudgeOnline/problem.php?id=3362 [算法] 带权并查集 时间复杂度 : O(NlogN) [代码] #include<bits/stdc++.h> using namespace std; ; struct Que { int f1 , f2 , t; int id; } que[MAXN]; int n , m; int f[MAXN] , dist[MAXN] , x[MAXN] , y[MAXN] ,…