离线后逆序处理所有操作,那么就变成了加边询问,根据MST的性质,显然维护MST询问链上max即可 #include <bits/stdc++.h> using namespace std; #define int long long const int N = 1000000; int n,m,q,t1,t2,t3,t4; struct Edge { int u,v,w,f; } e[N]; struct Operating { int o,p,q; } op[N]; struct LinkC…