
最小生成树
文章平均质量分 81
u010660276
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
最小生成树--poj1251
Jungle RoadsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 17473 Accepted: 7885DescriptionThe Head Elder of the tropical island of Lagrishan has a原创 2013-08-07 15:11:17 · 731 阅读 · 1 评论 -
最小生成树(kruskal)Codeforces 472D
D. Design Tutorial: Inverse the ProblemThere is an easy way to obtain a new task from an old one called "Inverse the problem": we give an output of the original task, and ask to generate an in原创 2014-10-08 22:14:43 · 1072 阅读 · 0 评论 -
最小生成树+LCA+uva11354
BNEXT Generation Contest 4Time Limit – 8 secsBond Once again, James Bond is on his way tosaving the world. Bond's latest mission requires him to travel between seve原创 2014-08-13 16:49:07 · 948 阅读 · 0 评论 -
最小生成树变形uva534
Kruskal第一次连接的时候就是最小值原创 2014-05-01 14:06:08 · 588 阅读 · 0 评论 -
最大的最小边+Kruskal+uva10099
The Tourist GuideInput: standard inputOutput: standard output Mr. G. works as a tourist guide.His current assignment is to take some tourists from one city to another. Sometwo-way roads connec原创 2013-12-14 15:19:25 · 619 阅读 · 0 评论 -
有已知边的最小生成树Kruskal+Uva10397
Problem EConnect the CampusInput: standard inputOutput: standard outputTime Limit: 2 secondsMany new buildings are under construction on the campus of the University of Waterloo. The univers原创 2013-12-04 21:44:06 · 627 阅读 · 0 评论 -
Kruskal求两点之间边权值最小的边+Uva10048
Problem B: Audiophobia Consider yourself lucky! Consider yourself lucky to be still breathing and having fun participating in this contest. But we apprehend that many of your descendants m原创 2013-12-03 16:03:28 · 1145 阅读 · 0 评论 -
次小生成树--poj11679
Language:DefaultThe Unique MSTTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 18336 Accepted: 6378DescriptionGiven a connected undirected graph,原创 2013-11-12 21:51:55 · 529 阅读 · 0 评论 -
最小生成树的最大边poj2395
Language:DefaultOut of HayTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9673 Accepted: 3717DescriptionThe cows have run out of hay, a horrible原创 2013-10-03 16:06:38 · 922 阅读 · 0 评论 -
kruskal--poj3723
Language:DefaultConscriptionTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6367 Accepted: 2201DescriptionWindy has a country, and he wants to原创 2013-09-17 19:53:41 · 696 阅读 · 0 评论 -
最小生成树(prim)--poj2377
Language:DefaultBad CowtractorsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9438 Accepted: 4037DescriptionBessie has been hired to build a ch原创 2013-10-01 20:09:35 · 759 阅读 · 0 评论 -
最小生成树--poj2485
Language:DefaultHighwaysTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 18966 Accepted: 8794DescriptionThe island nation of Flatopia is perfectl原创 2013-08-19 20:27:28 · 2355 阅读 · 0 评论 -
最小生成树--poj1758
题意:用一个7位的string代表一个编号,两个编号之间的distance代表这两个编号之间不同字母的个数。一个编号只能由另一个编号“衍生”出来,代价是这两个编号之间相应的distance,现在要找出一个“衍生”方案,使得总代价最小,也就是distance之和最小。例如有如下4个编号:aaaaaaabaaaaaaabaaaaaaabaaaa显然的,第二,第三和第四编号分原创 2013-08-07 20:09:00 · 806 阅读 · 0 评论 -
最小生成树(prim)--poj2349
Language:DefaultArctic NetworkTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 7917 Accepted: 2638DescriptionThe Department of National Defence (原创 2013-08-19 21:37:08 · 684 阅读 · 0 评论 -
最小生成树(prim算法)--poj1258
第一次做图论的题目,这是一道最小生成树的入门题,用的是prim算法。题意:要在村子里连上互联网,从john家作为起点,问最短的路径。思路:prim算法,use用来标识是否在最小生成树中,dist相当于存储生成树外节点与生成树节点的最短边长。#include#include#include#include#includeusing namespace std;int farm原创 2013-08-07 11:33:37 · 606 阅读 · 0 评论 -
最小生成树(Kruskal算法)--poj2421
这应该算是最小生成树(Kruskal算法)基础题目吧(虽然现在对自己来说还不是很熟悉)。题意:n个村庄想要彼此联通,已经有一些之间有了公路,问最短还要建多长的公路。思路:Kruskal算法,从1~1000枚举道路的长度,根据并查集操作,查询当前边的节点是否已经连通,如果没有联通,则答案加上这条边的长度,并把两个节点并入一个集合。#includeusing namespace std;原创 2013-08-07 13:21:15 · 814 阅读 · 1 评论 -
prim算法模板
下面是最小生成树prim算法的模板,个人觉得需要注意的是,dis初始化的时候,要初始化为很大的值。int prim() //复杂度O(N^2){ int result = 0; int minCost; int i,j,k; lowCost[0] = -1; //从结点0开始 for(i = 1; i< n; i++) lowCost[i]原创 2013-08-07 15:23:55 · 840 阅读 · 1 评论 -
LCT+最小生成树+并查集+离线(BZOJ2594)
2594: [Wc2006]水管局长数据加强版Time Limit: 25 Sec Memory Limit: 128 MBSubmit: 1278 Solved: 404[Submit][Status][Discuss]DescriptionSC省MY市有着庞大的地下水管网络,嘟嘟是MY市的水管局长(就是管水管的啦),嘟嘟作为水管局长的工作就是:每天供水公司可能要原创 2015-04-05 11:47:52 · 859 阅读 · 0 评论