码迷,mamicode.com
首页 >  
搜索关键字:hdu3371    ( 9个结果
HDU3371 最小生成树
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=3371 Connect the Cities Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
分类:其他好文   时间:2018-06-19 20:11:42    阅读次数:161
hdu3371 Connect the Cities (MST)
Connect the Cities Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 13722 Accepted Submission(s): ...
分类:其他好文   时间:2017-06-04 21:10:37    阅读次数:196
hdu3371 Connect the Cities (MST)
Connect the Cities Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 13722    Accepted Submission(s): 3711 Problem Description In 210...
分类:其他好文   时间:2015-08-13 20:12:39    阅读次数:234
【HDU3371】Connect the Cities
最小生成树~...
分类:其他好文   时间:2015-05-28 09:41:24    阅读次数:148
hdu 3371 Connect the Cities Prim + Kruskal两种算法分别AC 水过~~~~
Problem Description In 2100, since the sea level rise, most of the cities disappear. Though some survived cities are still connected with others, but most of them become disconnected. The government wants to build some roads to connect all of these cities ...
分类:编程语言   时间:2015-02-23 17:57:24    阅读次数:271
HDU3371 Connect the Cities【Kruskal】
题目大意:首先是T组数据,之后每组第一行是N M K,表示N个城市,M条路的信息,和 已经连接上的K个城市信息。接下来M行每行是城市A到B建路需要的花费。再接下来K行每 行第一个数为t,之后t个数表示已经连接在一起的城市。简单说,就是给你N个城市和M条 路的花费,再给你已经联通的城市,求连接所有城市的最小生成树总权值是多少。 思路:用kruskal算法来做,先把联通的城市并入集合,再依次并入边权值最小的边,直到 并到N-1条边,就生成了最小生成树。如果并完了没有达到N-1条边,就是不能联通,输出 "-1"。...
分类:其他好文   时间:2014-12-27 14:01:30    阅读次数:156
HDU3371 Connect the Cities
题目描述:有n个小岛,其中有的小岛之间没有通路,要修这样一条通路需要花费一定的钱,还有一些小岛之间是有通路的。现在想把所有的岛都连通起来,求最少的花费是多少。输入:第一行输入T,代表多少组数据。第二行输入三个整数n , m , k,分别代表一共有n个小岛,m条路径可供选择,k表示有连通岛的个数。接下...
分类:其他好文   时间:2014-11-13 00:33:24    阅读次数:192
HDU3371 Connect the Cities 【最小生成树Kruskal】
Connect the Cities Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 9856    Accepted Submission(s): 2800 Problem Description In 2100...
分类:其他好文   时间:2014-08-07 15:44:50    阅读次数:231
【HDU3371】Connect the Cities(MST基础题)
注意输入的数据分别是做什么的就好。还有,以下代码用C++交可以过,而且是500+ms,但是用g++就会TLE,很奇怪。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #inc...
分类:其他好文   时间:2014-07-24 22:10:12    阅读次数:234
9条  
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!