摘要:
传送门 ** 出现最大路径权值就应该联想到克鲁斯卡尔重构树,我们对于克鲁斯卡尔重构树求一遍dfs序,维护所有白色点的最大最小dfn(包括出发点),求出最大最小dfn的最近公共祖先既是答案。注意需要特判一下除了本身以外没有白色点情况。** #include <bits/stdc++.h> int n, 阅读全文
摘要:
传送门 挂个题,免得自己忘了。 #include <iostream> #include <algorithm> #include <cstring> typedef long long ll; typedef std::pair<double, int> PDI; const int N = 1e 阅读全文