E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
hdu3371
HDU3371
并查集与最小生成树(判断有无生成树)
ConnecttheCitiesTimeLimit:2000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):15073 AcceptedSubmission(s):4037ProblemDescriptionIn2100,sincethesealevelrise,mostofthe
zcj5027
·
2016-02-02 21:00
【
HDU3371
】Connect the Cities(MST基础题)
注意输入的数据分别是做什么的就好。还有,以下代码用C++交可以过,而且是500+ms,但是用g++就会TLE,很奇怪。 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <cstdlib> 5 #include &l
·
2015-11-11 12:59
connect
Connect the Cities(
hdu3371
)并查集(附测试数据)
Connect the Cities Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7338 Accepted Submission(s): 2093 Proble
·
2015-10-27 14:42
connect
hdu3371
Connect the Cities (MST)
ConnecttheCitiesTimeLimit:2000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):13722 AcceptedSubmission(s):3711ProblemDescriptionIn2100,sincethesealevelrise,mostofthe
su20145104009
·
2015-08-13 19:00
HDU
MST
hdu3371
3371
HDU3371
Connect the Cities【Kruskal】
ConnecttheCitiesTimeLimit:2000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):11152 AcceptedSubmission(s):3155ProblemDescriptionIn2100,sincethesealevelrise,mostoftheciti
u011676797
·
2014-12-27 11:00
Hdu3371
【最小生成树】
/*ConnecttheCities TimeLimit:2000/1000ms(Java/Other)MemoryLimit:32768/32768K(Java/Other) TotalSubmission(s):0AcceptedSubmission(s):0 Font:TimesNewRoman|Verdana|Georgia FontSize:←→ ProblemDescription I
u014641529
·
2014-11-12 18:00
c
HDU3371
Connect the Cities 【最小生成树Kruskal】
ConnecttheCitiesTimeLimit:2000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):9856 AcceptedSubmission(s):2800ProblemDescriptionIn2100,sincethesealevelrise,mostofthec
u012846486
·
2014-08-07 15:00
hdu3371
HDU3371
PRIM#include#include#include#definemaxn10000+10#defineINF10000000usingnamespacestd;intn,t,m,k,cost,a,b,num;intrest[maxn];intvis[maxn];intdis[maxn];intgraph[maxn][maxn];voidprim(intn){ inti,j,sum=0,po
u013570474
·
2014-04-22 20:00
hdu3371
这题本来不想写题解的,太容易了,就赤裸裸的最小生成树,不过由于我没考虑会有重边输入,所以我就wa了几遍,看了别人的评论后才改过ac了细节是魔鬼吖!!!prime算法也531ms过的,估计克鲁斯卡尔算法不优化的话会超时,毕竟是25000条边531ms代码#includeint g[505][505];int prime(int n){ int min,i,j,k,sum=0; int lowest[
qeroLai
·
2014-02-13 17:26
卡尔
克鲁斯
hdu3371
Connect the Cities
ConnecttheCitiesTimeLimit:2000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):6362 AcceptedSubmission(s):1838ProblemDescriptionIn2100,sincethesealevelrise,mostofthec
guodongxiaren
·
2013-07-25 11:00
kruskal
MST
hdu3371
hdu3371
之最小生成树
ConnecttheCitiesTimeLimit:2000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):6323 AcceptedSubmission(s):1823ProblemDescriptionIn2100,sincethesealevelrise,mostofthec
xingyeyongheng
·
2013-07-18 21:00
hdu3371
Connect the Cities (最小生成树)
#include #include usingnamespacestd; structnode { intx,y,val; }w[25002*3]; intfather[505]; boolcmp(constnode&a,constnode&b) { returna.val #include #defineINF10000000 #defineMAX505 intmap[MAX][MAX];
lezong2011
·
2013-07-13 09:00
最小生成树之Prim算法的学习心得与个人总结
最小生成树之Prim算法的学习心得与个人总结最小生成树:MST从4.24到今天5.4(除去29,30,1三天假期),完成了hdu1162,hdu1102,
hdu3371
,hdu1233,hdu1879,
Chuck_0430
·
2013-05-04 17:08
ACM
最小生成树之Prim算法的学习心得与个人总结
最小生成树之Prim算法的学习心得与个人总结最小生成树:MST 从4.24到今天5.4(除去29,30,1三天假期),完成了hdu1162,hdu1102,
hdu3371
,hdu1233,hdu1879
Chuck_0430
·
2013-05-04 17:00
hdu3371
题目是不是变态,我就不评论了,不过我的确学了不少东西 如果让我说:我只能说,实力决定一切
思路:刚开始想把已经修好的路,放到同一集合中去,不过发现这样做在查找根节点时,会出错,我就把已修好的路的花费设为0,放到优先队列中,不过这样挺浪费时间滴。C++提交卡过,G++,TL #include #include #include #include usingnamespacestd; structnode { intst,ed,w; boolfriendoperatorb.
wahaha1_
·
2013-04-24 15:00
hdu3371
/*分析: 简单prim,还connected的边将其长度记为0就行了。在k次读入的时候,每次给了t个数,不用进行C(t,2)次赋值让map[a][b]=map[b][a]=0,只用进行t-1次就行了,让这t个数成一个链啊什么的,不用出现回路。 2012-06-17*/#include"stdio.h" #include"stdli
Ice_Crazy
·
2012-06-17 21:00
HDU_Steps 6.1 生成树 HDU1102 HDU1162 HDU1232 HDU1233 HDU1879 HDU1301
HDU3371
HDU3367
HDU_STEPS6.1最小生成树 6.1.1HDU1102ConstructingRoads裸的最小生成树6.1.2HDU1162Eddy'spicture最小生成树,每两点直接连线建图6.1.3HDU1232畅通工程用并查集将图分块,然后修N-1条路即可6.1.4HDU1233还是畅通工程还是最小生成树6.1.5HDU1879继续畅通工程在已生成部分图的情况下生成最小生成树,输入的时候用并查集
swm8023
·
2011-10-20 15:00
c
ini
hdu3371
Connect the Cities
ConnecttheCitiesTimeLimit:2000/1000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):868 AcceptedSubmission(s):308ProblemDescriptionIn2100,sincethesealevelrise,mostofthecit
power721
·
2010-04-10 12:00
struct
Integer
iterator
Build
each
output
上一页
1
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他