Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 29773 Accepted: 12080 Description Every cow's dream is to become the most popu ...
分类:
其他好文 时间:
2016-06-25 15:05:02
阅读次数:
183
题目链接: http://www.lydsy.com/JudgeOnline/problem.php?id=1051 题解: 强连通缩点得到DAG图,将图转置一下,对入度为零的点跑dfs看看能不能访问到所有的点。 代码: ...
分类:
其他好文 时间:
2016-06-06 21:53:27
阅读次数:
196
Circle of Friends
Time Limit: 2000ms Memory limit: 65536K 有疑问?点这里^_^
强连通缩点+BFS(找最短距离);
题目描述
Nowadays, "Circle of Friends" is a very popular social networking platform in WeChat. W...
分类:
其他好文 时间:
2016-05-06 12:36:48
阅读次数:
208
Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 29141 Accepted: 11779 Description Every cow's dream is to become the most popu ...
分类:
其他好文 时间:
2016-05-03 20:13:50
阅读次数:
167
题目链接 题意:给定一个有向图。强连通分支内传送不须要花费,其它有一定花费。每次询问两点的最小花费 思路:强连通缩点后求最短路就可以 代码: #include <cstdio> #include <cstring> #include <vector> #include <queue> #includ ...
分类:
其他好文 时间:
2016-03-24 14:36:44
阅读次数:
224
http://poj.org/problem?id=3177题目大意:给你几个点和几条边 求你能加几条边 就可以让每一个点到达任意点都有两种方法。DescriptionIn order to get from one of the F (1 2 and 1 –> 6 –> 5 –> 21 – 4.....
分类:
其他好文 时间:
2015-10-28 19:22:34
阅读次数:
174
Equivalent SetsProblem DescriptionTo prove two sets A and B are equivalent, we can first prove A is a subset of B, and then prove B is a subset of A, ...
分类:
其他好文 时间:
2015-10-09 19:47:46
阅读次数:
199
id=2553">主题链接题意:求解Bottom(G)。即集合内的点能够互相到达。思路:有向图的强连通。缩点,找出出度为0的点,注意符合的点要按升序输出。代码:#include #include #include #include using namespace std;const int MAXN...
分类:
其他好文 时间:
2015-09-20 18:58:56
阅读次数:
152
题意:有多个命题,需要证明他们可以互相推出,现在已经有一些证明关系即 A 可以证明 B,问至少还需要多少证明关系。首先,如果某几个命题证明关系可以成环,那么这些命题必然可以相互证明,只要沿着环的边走就能到达其他命题,所以首先是需要强连通缩点,之后对于一个无环图,我们发现如果一个强连通分量它无出度,那...
分类:
其他好文 时间:
2015-09-10 22:28:44
阅读次数:
222
原题链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2288题意:给你一个有向图,问你至少需要添加多少条边,使得整个图强连通。题解:就。...
分类:
其他好文 时间:
2015-09-08 20:10:43
阅读次数:
181