Agri-Net
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 38918
Accepted: 15751
Description
Farmer John has been elected mayor of his town! One of h...
分类:
Web程序 时间:
2014-07-23 17:08:01
阅读次数:
224
poj:1258Agri-NetTime Limit: 1000 MS Memory Limit: 10000 KB64-bit integer IO format: %I64d , %I64u Java class name: Main[Submit] [Status] [Discuss]Desc...
分类:
其他好文 时间:
2014-07-23 15:06:26
阅读次数:
365
Sunny Cup 2003 - Preliminary Round
April 20th, 12:00 - 17:00
Problem E: QS Network
In the planet w-503 of galaxy cgb, there is a kind of intelligent creature named QS. QScommunicate with each...
分类:
其他好文 时间:
2014-07-23 13:14:06
阅读次数:
288
本文出自:http://blog.csdn.net/svitter
一.图的生成树
.必然含有n-1条边。
.无向带权图。
.如何求最小生成树。
.prime | kruskal
Prime: 从点里面找一个最短的边。
kruskal: 从边里面找。
.密集图使用邻接矩阵来存储。
...
分类:
其他好文 时间:
2014-07-23 00:10:07
阅读次数:
254
Network
Time Limit: 1000MS
Memory Limit: 30000K
Total Submissions: 13266
Accepted: 5123
Special Judge
Description
Andrew is working as system administrator and...
分类:
Web程序 时间:
2014-07-23 00:07:57
阅读次数:
331
题意:就是要你求最小生成树所需的最小距离
思路:Kruskal算法
AC代码:
#include
#include
#include
using namespace std;
#define N 125000
int u[N],v[N],w[N],r[N];
int f[520],str[520][520];
int find(int x)
{
if(x!=f[x])
...
分类:
Web程序 时间:
2014-07-23 00:03:57
阅读次数:
266
本文出自:http://blog.csdn.net/svitter
题意:给出一个数字n代表邻接矩阵的大小,随后给出邻接矩阵的值。输出最小生成树的权值。
题解:
prime算法的基本解法;
1.选择一个点,然后不停的向其中加入权值最小的边,边的一端在已经生成的部分生成树中,另一端在未生成的生成树中。
2.利用优先队列维护边,将加入的点所包含的边加入到队列中去,随后按照边的权值弹出...
分类:
其他好文 时间:
2014-07-22 23:57:38
阅读次数:
596
题意:若干个人开车要去park聚会,但是park能停的车是有限的,为k。所以这些人要通过先开车到其他人家中,停车,然后拼车去聚会。另外,车的容量是无限的,他们家停车位也是无限的。求开车总行程最短。
就是求一最小生成树,但是对于其中一个点其度不能超过k。
思路:
1. 将park点取出 将剩下的点求出最小生成树 出现i个联通块
2. 再每个块中选择与park点相邻的最小边...
分类:
其他好文 时间:
2014-07-22 23:45:38
阅读次数:
281
最小生成树水题。prim一次AC 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 10 #define typec int11 using namesp...
分类:
其他好文 时间:
2014-07-22 23:29:57
阅读次数:
235
Description
The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Flatopian government is aware of this problem...
分类:
其他好文 时间:
2014-07-22 18:01:17
阅读次数:
230