最小生成树计数
Minimum Spanning Tree http://acm.hdu.edu.cn/showproblem.php?pid=4408 模板题 1 #include<cstdio> 2 #include<cstring> 3 #include<queue> 4 #include<stack> 5 #include<algorithm> 6 #define mt(a,b) memset(a,b,sizeof(a)) 7 using namespace std; 8 typedef __int64 LL; 9 class MinST_count { ///最小生成树计数o(~=MV^3)+o(MElogME) 10 typedef int typec;///边权的类型 11 typedef LL typer;///返回值类型 12 static const int ME=1024;///边的个数 13 static const int MV=128;///点的个数 14 struct E { 15 int u,v; 16 typec w; 17 friend bool operator <(E a,E b) { 18 return a.w<b.w; 19 } 20 } e[ME]; 21 typer mod,ans,mat[MV][MV]; 22 int n,le,fa[MV],ka