摘要:
求一个生成树,使得最大边权和最小边权之差最小。由于数据太小,暴力枚举下界,求出相应的上界。最后取min即可。 1 #include 2 #include 3 #include 4 using namespace std; 5 int n,m,fa[101],rank[101]; 6 void cle... 阅读全文
摘要:
不用Matrix-tree定理什么的,一边kruscal一边 对权值相同的边 暴搜即可。将所有方案乘起来。 1 #include 2 #include 3 using namespace std; 4 int n,m; 5 struct Disjoint_Set 6 { 7 int fa[1... 阅读全文