![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
图论
yangshuolll
这个作者很懒,什么都没留下…
展开
-
hdu 2544 最短路 图论-求两点之间的最短距离 Dijkstra
最短路 Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 15501 Accepted Submission(s): 6595 Problem Description 在每年的校赛里,所有进入决赛的同学都会获得原创 2012-08-28 20:05:02 · 2339 阅读 · 0 评论 -
poj 1797 Heavy Transportation 用的dp的思想
Heavy Transportation Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 15948 Accepted: 4162 Description Background Hugo Heavy is happy. After the breakdo原创 2012-09-02 18:42:03 · 708 阅读 · 0 评论 -
poj Out of hay 最小生成树 kruscal
题目链接 题意 就是求最小生成树中最大的那条边,题目看了n 久才看懂。 直接采用的是kruscal 算法,并查集+快排。 原先以为会好难~~ 其实并查集用一句话就搞定了,快排结构体 简单爆了 post code: #include #include #include using namespace std; struct edge{ int x,y,w; }a[2原创 2013-04-14 13:03:08 · 920 阅读 · 0 评论 -
2012 Maryland High School Battleground Preservation map容器+Floyd
题目链接地址 第五题 当时不知怎么~~竟然让羽哥写了dijkstra~求两源的最短路~~其实还可以用Floyd来写 多源的最短路~~ 下面是自己写的Flody +map代码: #include #include #include using namespace std; #define INF 1000000000 int pic[111][111]; void init(int n){原创 2013-04-25 00:34:13 · 937 阅读 · 0 评论 -
poj 1502 MPI Maelstrom SPFA 用队列来优化
题目链接 典型的求最短路径的问题,从1这个节点开始求解~~ 找出距离1最远的最短路径。 #include #include #include #include #include #include #include #include #include #define maxn 1000 #define INF 100000000 using namespace std;原创 2013-04-25 22:59:48 · 1009 阅读 · 0 评论 -
迷宫问题 poj 3984 搜索算法 宽搜+dfs回溯
题目链接地址 很简单的搜索,只要广搜就可以了,然后就是记录搜索地址,最后我竟然又用了一遍DFS(),求出了最后的路径。 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 宽搜后的结果,然后再DFS回溯求返回路径就可以 1 0 7 8 0 2 0 6 0 8 3 4 5 6 7 4 0 0 0 8 5 6 7 0 9 最原创 2013-06-16 00:42:00 · 1562 阅读 · 0 评论