摘要:
#include<iostream> #include<cstring> using namespace std; const int N=2e5+10; int m,n,p; struct node{ int l,r; int v; }tr[N*4]; void pushup(int u) { t 阅读全文
posted @ 2020-02-08 20:18
晴屿
阅读(109)
评论(0)
推荐(0)
摘要:
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; typedef long long LL; const int N = 50005; int n; i 阅读全文
posted @ 2020-02-08 19:24
晴屿
阅读(101)
评论(0)
推荐(0)
摘要:
#include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N=2e5+10; int n,m; int p[N]; struct edge{ int a,b; int w; }e[N 阅读全文
posted @ 2020-02-08 17:56
晴屿
阅读(123)
评论(0)
推荐(0)
摘要:
#include<iostream> #include<cstring> #include<cstdio> using namespace std; const int N=200000+10; int p[N]; int w[N]; int find(int x) { if(p[x]==x) re 阅读全文
posted @ 2020-02-08 17:27
晴屿
阅读(139)
评论(0)
推荐(0)
摘要:
//有n个成员,并查集开两倍空间 //1~n为一组, n+1~2n为一组。a与b互斥,则a与b反(即b+n)为同一集合, //同时b与a反(a+n)为同一集合 //在union操作中,引入w ,w越大,表面它的根连接的点越多 //合并时确立关系 #include<iostream> using na 阅读全文
posted @ 2020-02-08 14:01
晴屿
阅读(133)
评论(0)
推荐(0)
摘要:
#include<iostream> #include<cstring> using namespace std; const int N=1010; int p[N]; int find(int x) { if(p[x]!=x) p[x]=find(p[x]); return p[x]; } in 阅读全文
posted @ 2020-02-08 13:37
晴屿
阅读(106)
评论(0)
推荐(0)