![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
图论
SugarSBN
这个作者很懒,什么都没留下…
展开
-
割点判断(tarjan)
/* 割点判断 tarjan by sbn*/#include<iostream>#include<cstdio>using namespace std;struct node{ int x,y,nxt; node(){} node(int nx,int ny,int nnxt){ x=原创 2017-12-25 19:49:14 · 924 阅读 · 0 评论 -
最近公共祖先LCA tarjan
/* 最近公共祖先LCA tarjan by sbn*/#include<iostream>#include<cstdio>#include<cstring>using namespace std;struct edge{ int x,y,nxt; edge(){} edge(int nx,int ny,int nn原创 2017-12-25 19:52:50 · 137 阅读 · 0 评论 -
【P2661】信息传递【并查集】查找最小环
/* 信息传递 P2661 有向图最小环 algorithm:并查集 by sbn 2018-1-14*/#include<iostream>#include<cstdio>#include<cstdlib>#include<cstring>#include<string>#include<cmath>#include<algorithm>原创 2018-01-14 18:17:50 · 798 阅读 · 0 评论 -
强连通分量模板+DAGdp 洛谷P3387
/* luogu P3387 缩点(强连通分量)+DAGdp by sbn 2018-2-11 algorithm:Kosaraju */#include<iostream>#include<cstdio>#include<cstdlib>#include<cstring>#include<algorithm>#...转载 2018-02-11 16:05:55 · 356 阅读 · 0 评论 -
[Codeforces][976D] 图的构造 Educational Codeforces Round 43 (Rated for Div. 2) D. Degree Set
超喜欢这题的说题目大意:给你一个正整数集,其中最大数为n,求构造一个图,使得有n+1个结点且这个图的结点的度组成的集合等于所给集合这题在加里·查特兰所著的《图论----一个迷人的世界中》 出现在定理2.3.不过这本书好像挺难找的书上大意写了下,我看了半天马马虎虎理解,然后自己YY着想出了构造方法构造图最有趣了是这样的,我们假设要构造一个度集为{d}(d1<d2<d3<......原创 2018-05-01 20:35:16 · 333 阅读 · 0 评论