求sdom sdom[u]=fa[u] dfn[v]>dfn[u] 即(v->u)为横插边或反组边 则有sdom[u]=Min(sdom[u],sdom[x]),x为v到根的路径节点中已连通点中sdom最小的节点 求idom ...
分类:
其他好文 时间:
2017-12-24 14:40:17
阅读次数:
154
#include #include #include #define N 20005 typedef long long ll; using namespace std; ll n,K,fa[N],sze[N],son[N],dis[N],head[N],ecnt,ans,tot; bool vis... ...
分类:
其他好文 时间:
2017-12-20 03:55:14
阅读次数:
109
1、zip命令打包指定文件,-r参数递归打包目录下的子目录和文件 zip -r target.zip file1 file2 file3 folder 2、打包排除文件 排除当前目录,fa目录下所有modules文件夹 zip -r zipdemo.zip . -x "fa/*/modules/*" ...
分类:
其他好文 时间:
2017-12-19 01:04:08
阅读次数:
125
PROBLEM: (ENGLISH VERSION) Farmer John had just acquired several new farms! He wants to connect the farms with roads so that he can travel from any fa ...
分类:
编程语言 时间:
2017-12-17 18:21:57
阅读次数:
186
#include #include #include using namespace std; int beg[200010],en[200010],num[200010],fa[200010],ch[200010][2],root,N; inline void flow(int n){ num[n... ...
分类:
其他好文 时间:
2017-12-10 11:30:58
阅读次数:
176
描述:并查集是一种对集合进行合并、查询等一系列操作。时间复杂度为O(a(n)) 比O(logn)还快。 代码: 1 int fa[sz];//集合数组 2 void init()//预处理 3 { 4 for(int i=1;i<=n;i++) 5 { 6 fa[i]=i;//初始时每个点都是一个独 ...
分类:
其他好文 时间:
2017-12-09 22:41:30
阅读次数:
219
http://www.lydsy.com/JudgeOnline/problem.php?id=2588 在树上建主席树 每个节点按它的father建一颗新树 对于路径(u,v)等价于(1,u)+(1,v)-(1,lca(u,v))-(1,fa[lca(u,v)]) root[u],root[v], ...
分类:
其他好文 时间:
2017-12-03 20:55:03
阅读次数:
157
题意:食物链的弱化版本 解题关键:种类并查集,注意向量的合成。 $rank$为1代表与父亲对立,$rank$为0代表与父亲同类。 法二:$fa$数组代表$i$属于$A$或$i$属于$B$ ...
分类:
其他好文 时间:
2017-12-02 00:40:24
阅读次数:
161
null和undefined基本是同义的,只有一些细微的差别。 在JavaScript中,将一个变量赋值为undefined或null,老实说,几乎没区别。 上面代码中,a变量分别被赋值为undefined和null,这两种写法几乎等价。 undefined和null在if语句中,都会被自动转为fa ...
分类:
其他好文 时间:
2017-12-01 16:39:46
阅读次数:
132
#include using namespace std; int fa[10005],n,m,type,a,b; int father(int x) { if (fa[x] == x) return x; fa[x] = father(fa[x]); return fa[x]; } int mai... ...
分类:
其他好文 时间:
2017-11-30 22:13:56
阅读次数:
114