wanide
wanide
全部文章
分类
2018蓝桥杯(7)
C语言(77)
dp(3)
hdu(3)
Java(13)
KMP(1)
POJ(3)
字符串(2)
并查集(2)
数据结构(5)
最小生成树(2)
最短路(5)
未归档(100)
深度优先搜索/广度优先搜索(4)
贪心(1)
归档
标签
去牛客网
登录
/
注册
仙女的博客
面朝大海,然后春暖花开
全部文章
(共228篇)
POJ 1751 - Highways (Prim)
The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor system of public highways. The Flatopian government is aware ...
2018-07-30
0
327
POJ 1258 - Agri-Net (Prim最小生成树)
Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs you...
2018-07-29
0
513
POJ 2031 - Building a Space Station (Prim 最小生成树)
You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write ...
2018-07-29
0
302
最小生成树一·Prim算法 (模板题)
描述 最近,小Hi很喜欢玩的一款游戏模拟城市开放出了新Mod,在这个Mod中,玩家可以拥有不止一个城市了! 但是,问题也接踵而来——小Hi现在手上拥有N座城市,且已知这N座城市中任意两座城市之间建造道路所需要的费用,小Hi希望知道,最少花费多少就可以使得任意两座城市都可以通过所建造的道路互相到达...
2018-07-29
0
401
最小生成树二·Kruscal算法(模板题)
描述 随着小Hi拥有城市数目的增加,在之间所使用的Prim算法已经无法继续使用了——但是幸运的是,经过计算机的分析,小Hi已经筛选出了一些比较适合建造道路的路线,这个数量并没有特别的大。 所以问题变成了——小Hi现在手上拥有N座城市,且已知其中一些城市间建造道路的费用,小Hi希望知道,最少花费多...
2018-07-29
0
443
HDU 1102 - Constructing Roads ( Prim 最小生成树 )
There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say t...
2018-07-29
0
455
POJ 1860 - Currency Exchange (正权回路 Bellman - Ford)
Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchang...
2018-07-28
0
314
最短路的四种的求解方法+模板
一、Floyd算法: Floyd算法只有五行代码,代码简单,三个for循环就可以解决问题,所以它的时间复杂度为O(n*n*n),可以求多源最短路问题。 Floyd算法可以处理带有负权边,但不能处理带有“负权回路”的图。 核心代码: for(k=1;k<=n;k++) ...
2018-07-28
0
392
POJ 1062 - 昂贵的聘礼 (dijkstra)
年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要50...
2018-07-27
0
387
POJ 1797 - Heavy Transportation (最短路变形 Dijkstra)
Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whe...
2018-07-27
0
488
首页
上一页
10
11
12
13
14
15
16
17
18
19
下一页
末页