输入数据处理正确其余的就是套强联通的模板了#include #include #include #include #include #include #include #include #include using namespace std;#define INF 0xfffffff#define...
分类:
Web程序 时间:
2015-04-28 15:41:31
阅读次数:
132
求割点一种显然的n^2做法: 枚举每个点,去掉该点连出的边,然后判断整个图是否联通用tarjan求割点: 分情况讨论 如果是root的话,其为割点当且仅当下方有两棵及以上的子树 其他情况 设当前节点为u,一个儿子节点为v 存在low[v]>=dfn[u],也就是说其儿子节点v能连到的最前...
分类:
其他好文 时间:
2015-04-27 14:59:24
阅读次数:
121
大致题意:
给出一个连通的无向图,求哪些点是割点,对于每个割点,求出去掉这个点后连通分量的个数。如果没有割点的话输出“ No SPF nodes”。
思路:
求割点用tarjan即可,然后要求删除割点后连通分量的个数,每次找到割点,再在从割点dfs即可,也可以直接在tarjan算法中记录child个数。那么如果割点是根,那么答案就是child,不是根的割点答案是child+1
//1...
分类:
其他好文 时间:
2015-04-24 09:09:55
阅读次数:
111
NetworkTime Limit:1000MSMemory Limit:10000KTotal Submissions:10286Accepted:4775DescriptionA Telephone Line Company (TLC) is establishing a new telepho...
分类:
其他好文 时间:
2015-04-17 17:34:38
阅读次数:
130
这题真是没什么好说的。。。赤裸裸的求割点直接模板上 1 #include 2 #include 3 #include 4 #include 5 #define maxn 1100 6 7 using namespace std; 8 9 vector g[maxn];10 int dfn[max.....
分类:
其他好文 时间:
2015-04-14 22:48:01
阅读次数:
156
无向图求割点和连通块。 1 /* POJ2117 */ 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 10 #define MAXN 1000511 1...
分类:
其他好文 时间:
2015-03-22 01:37:12
阅读次数:
141
转载请注明出处,谢谢:http://www.cnblogs.com/KirisameMarisa/p/4319585.html ---by 墨染之樱花【题目链接】http://poj.org/problem?id=1144【题目描述】(半天才看明白。。。)给图求割点个数【思路】直接套求割点的模板即....
分类:
Web程序 时间:
2015-03-07 01:00:28
阅读次数:
196
http://acm.hdu.edu.cn/showproblem.php?pid=4587
Problem Description
Suppose that G is an undirected graph, and the value of stab is defined as follows:
Among the expression,G-i, -j is the ...
分类:
其他好文 时间:
2015-03-02 22:28:57
阅读次数:
241
题目大意
A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 to N. No two places have the same number. The lines a...
分类:
Web程序 时间:
2015-02-24 09:10:29
阅读次数:
159
传送门:Network题意:给出一张无向图,求割点的个数。分析:模板裸题,直接上模板。#include #include #include #include #include #include #include #include #include #include #include #include...
分类:
其他好文 时间:
2015-02-07 15:42:35
阅读次数:
97