摘要:
hdu3047题解:带权并查集裸题#include using namespace std;int const N = 50000 + 10;int n,m,a,b,x,f[N],val[N];int find(... 阅读全文
posted @ 2019-02-10 13:12
月光下の魔术师
阅读(3)
评论(0)
推荐(0)
摘要:
题解:带权并查集建议大家先学习一下HDU3038,其它的都一样。代码如下#include using namespace std;int const N = 100000 + 10;int n,m,q,fa[N]... 阅读全文
posted @ 2019-02-10 13:09
月光下の魔术师
阅读(4)
评论(0)
推荐(0)
摘要:
HDU3038题解:带权并查集简单的说,就是fx = fa[x],fy = fa[y],那么sum[x]即为区间[fx,x]的和,sum[y]即为区间[fy,y]的和如果fx == fy,即左端点相同,我们就要判... 阅读全文
posted @ 2019-02-10 13:04
月光下の魔术师
阅读(29)
评论(0)
推荐(0)
摘要:
hihocoder 1322判断是否构成树题解:DFS简单粗暴#include using namespace std;int const N = 500 + 10;int n,m;vectorG[N];bool... 阅读全文
posted @ 2019-02-10 12:53
月光下の魔术师
阅读(6)
评论(0)
推荐(0)
摘要:
hihocoder 1066题解:并查集裸题#include using namespace std;int const N = 100000 + 10;int n,k,fa[N];string s1,s2;ma... 阅读全文
posted @ 2019-02-10 12:51
月光下の魔术师
阅读(3)
评论(0)
推荐(0)

浙公网安备 33010602011771号