
ACM_最短路
kewlgrl
好大一只咸鱼哇
展开
-
HDU 1874-畅通工程续(Floyd)
畅通工程续Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 41306 Accepted Submission(s): 15257Problem Description某省自从实行了很多年的畅通工程计划后,终于修原创 2016-04-01 20:42:34 · 542 阅读 · 0 评论 -
POJ 3522-Slim Span(苗条树-kruskal生成树)
Slim SpanTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 8025 Accepted: 4272DescriptionGiven an undirected weighted graph G, you should find one of span原创 2017-05-04 08:39:30 · 698 阅读 · 0 评论 -
POJ 3026-Borg Maze(BFS+prim最小生成树)
Borg MazeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 14048 Accepted: 4580DescriptionThe Borg is an immensely powerful race of enhanced humanoids fro原创 2017-03-31 15:21:22 · 463 阅读 · 0 评论 -
C4top-直捣黄龙(dijkstra-最短路数目+多重条件判断)
直捣黄龙 本题是一部战争大片 —— 你需要从己方大本营出发,一路攻城略地杀到敌方大本营。首先时间就是生命,所以你必须选择合适的路径,以最快的速度占领敌方大本营。当这样的路径不唯一时,要求选择可以沿途解放最多城镇的路径。若这样的路径也不唯一,则选择可以有效杀伤最多敌军的路径。输入格式:输入第一行给出2个正整数N(2 \le≤ N \le≤ 200,城镇总数)和K(城镇间原创 2017-03-23 20:40:34 · 1467 阅读 · 0 评论 -
POJ 2031-Building a Space Station(最小生成树-三维坐标系)
Building a Space StationTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 8167 Accepted: 3920DescriptionYou are a member of the space station engineering原创 2017-02-04 14:36:36 · 499 阅读 · 0 评论 -
POJ 1789-Truck History(最小生成树-不同字母个数)
Truck HistoryTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 26434 Accepted: 10259DescriptionAdvanced Cargo Movement, Ltd. uses trucks of different type原创 2017-01-28 22:10:10 · 501 阅读 · 0 评论 -
POJ 2253-Frogger(最小生成树-给定终点)
FroggerTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 40659 Accepted: 13051DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Sudd原创 2017-01-25 22:46:43 · 857 阅读 · 0 评论 -
POJ 1125-Stockbroker Grapevine(最短路-含孤立点)
Stockbroker GrapevineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 35170 Accepted: 19528DescriptionStockbrokers are known to overreact to rumours. You原创 2017-01-25 21:47:12 · 554 阅读 · 0 评论 -
POJ 2485-Highways(最小生成树裸题-prim/kruskal)
HighwaysTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 27781 Accepted: 12690DescriptionThe island nation of Flatopia is perfectly flat. Unfortunately,原创 2016-06-01 21:37:32 · 1366 阅读 · 0 评论 -
POJ 3249-Test for Job(拓扑排序&&DP)
Test for JobTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 10339 Accepted: 2405DescriptionMr.Dog was fired by his company. In order to support his fa原创 2016-05-03 19:27:52 · 790 阅读 · 0 评论 -
POJ 1860-Currency Exchange(最短路-回路套汇)
Currency ExchangeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 28315 Accepted: 10548DescriptionSeveral currency exchange points are working in our c原创 2017-01-24 21:33:53 · 435 阅读 · 0 评论 -
POJ 1062-昂贵的聘礼(最短路-预处理限制点)
昂贵的聘礼Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 47240 Accepted: 14059Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给原创 2017-01-24 13:30:28 · 401 阅读 · 0 评论 -
Bellman Ford+SPFA队列优化(路径还原 输出最短路的路径)
①邻接表(效率较高)#include #include #include #include #include #include #include #include using namespace std;#define INF 0xfffffff#define MAXN 1010struct Edge{ int u,v,w;};Edge edge[MAXN原创 2016-08-02 09:05:16 · 1383 阅读 · 0 评论 -
POJ 2240-Arbitrage(套汇-Bellman Ford)
ArbitrageTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 20523 Accepted: 8740DescriptionArbitrage is the use of discrepancies in currency exchange rates原创 2016-08-02 10:02:30 · 791 阅读 · 0 评论 -
Dijkstra-路径还原 输出最短路的路径
在求解最短距离时,满足dis[j]=dis[k]+cost[k][j]的顶点k,就是最短路上的顶点j的前趋节点。以POJ 2387的题目和代码为例来修改:/** Copyright (c) 2016, 烟台大学计算机与控制工程学院* All rights reserved.* 文件名称:dijkstra.cpp* 作 者:单昕昕* 完成日期:2016年3月30日*原创 2016-06-01 12:31:52 · 3247 阅读 · 0 评论 -
POJ 2387-Til the Cows Come Home(Dijkstra+堆优化)
Til the Cows Come HomeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 40039 Accepted: 13620DescriptionBessie is out in the field and wants to get back t原创 2016-03-30 18:30:08 · 1399 阅读 · 0 评论 -
POJ 3159-Candies(差分约束系统-SPFA+邻接表)
CandiesTime Limit: 1500MS Memory Limit: 131072KTotal Submissions: 31137 Accepted: 8669DescriptionDuring the kindergarten days, flymouse was the monitor of his c原创 2017-04-26 16:06:33 · 607 阅读 · 0 评论