上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 63 下一页
摘要: #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)
摘要: #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #include<string> #include<map> typedef long long ll; using namespace std; in 阅读全文
posted @ 2020-02-07 21:39 晴屿 阅读(140) 评论(0) 推荐(0)
摘要: #include<iostream> #include<algorithm> #include<cstring> using namespace std; const int N=1e5; int a,b; int p[N+10]; // 标记走过的房间 bool vis[N+10]; int fi 阅读全文
posted @ 2020-02-02 11:44 晴屿 阅读(116) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cstring> #include<stdio.h> #include<map> #include<vector> #define cle(a) memset(a,0,sizeof(a)) using namespace std; const 阅读全文
posted @ 2020-02-01 23:22 晴屿 阅读(117) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cmath> #include<algorithm> using namespace std; const int N=4e4+10; // 东西 南北 int p[N],D[N],B[N]; struct node{ int x,y,d; c 阅读全文
posted @ 2020-02-01 21:21 晴屿 阅读(111) 评论(0) 推荐(0)
上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 63 下一页