图论
文章平均质量分 76
cqsh3vj2
这个作者很懒,什么都没留下…
展开
-
poj 1236 强连通分量 缩点
有向无环图中所有入度不为0的点,一定 可以由某个入度为0的点出发可达。 假定有 n 个入度为0的点,m个出度为0的点, max(m,n)就是第二个问题的解。原创 2014-05-06 20:08:09 · 374 阅读 · 0 评论 -
poj 2186 强连通分量 缩点
有向无环图中,如果有且仅有一个点的出度为0,则所有的点都可以到达它。 #include #include #include #include #include #include #include using namespace std; const int inf =0x3ffffff; const int maxn=10005;//点数 struct edge { int原创 2014-05-06 11:37:50 · 456 阅读 · 0 评论 -
hdu 4912 Paths on the tree lca+贪心
直线型的树会爆栈,手动扩栈:#pragma comment(linker, "/STACK:102400000,102400000")原创 2014-08-06 17:05:46 · 361 阅读 · 0 评论