wanide
wanide
全部文章
未归档
2018蓝桥杯(7)
C语言(77)
dp(3)
hdu(3)
Java(13)
KMP(1)
POJ(3)
字符串(2)
并查集(2)
数据结构(5)
最小生成树(2)
最短路(5)
深度优先搜索/广度优先搜索(4)
贪心(1)
归档
标签
去牛客网
登录
/
注册
仙女的博客
面朝大海,然后春暖花开
全部文章
/ 未归档
(共100篇)
HDU 2602 - Bone Collector (背包问题 dp)
Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s...
2018-08-01
0
387
HDU 2034 - 人见人爱A-B(好好看题...)
人见人爱A-B Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 98797 Accepted Submission(s): 275...
2018-07-31
0
379
最小生成树算法(Kruskal 算法 和 Prim算法)
Kruskal算法: 时间复杂度O(MlogM). 算法总结: 首先把给的边按照边的权值进行从小到大的排序,每次从剩余的边中选择权值较小且边的两个顶点不在同一个集合内的边(就是不会产生回路的边),加入到生成树中,直到加入了n-1条边为止。 完整代码: #includ...
2018-07-31
0
414
POJ 3026 - Borg Maze (BFS + Prim)
The Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to describe t...
2018-07-31
0
582
POJ 2349 - Arctic Network (最小生成树 Prim)
The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies a...
2018-07-30
0
348
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 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
最短路的四种的求解方法+模板
一、Floyd算法: Floyd算法只有五行代码,代码简单,三个for循环就可以解决问题,所以它的时间复杂度为O(n*n*n),可以求多源最短路问题。 Floyd算法可以处理带有负权边,但不能处理带有“负权回路”的图。 核心代码: for(k=1;k<=n;k++) ...
2018-07-28
0
392
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页