摘要: 洛谷3383 1 #include<cstdio> 2 #include<algorithm> 3 #include<cmath> 4 using namespace std; 5 const int maxn=10000010; 6 int n,m; 7 bool a[maxn]; //a[i]为 阅读全文
posted @ 2017-10-27 16:36 Driver_Lao 阅读(354) 评论(0) 推荐(0) 编辑
摘要: 洛谷3367 1 #include<cstdio> 2 #include<cstring> 3 using namespace std; 4 const int maxn=10010; 5 int n,m,x,y,k,fa[maxn]; 6 void read(int &k){ 7 k=0; int 阅读全文
posted @ 2017-10-27 16:16 Driver_Lao 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 【题解】 对于不同的最小生成树,每种权值的边使用的数量是一定的,每种权值的边的作用是确定的 我们可以先做一遍Kruskal,求出每种权值的边的使用数量num 再对于每种权值的边,2^num搜索出合法使用方案,把每种权值的边的方案用乘法原理乘起来就是答案了 1 #include<cstdio> 2 # 阅读全文
posted @ 2017-10-27 07:47 Driver_Lao 阅读(254) 评论(0) 推荐(0) 编辑