
【最短路】
文章平均质量分 82
Gijkstra
Can we do better?
展开
-
poj2253~Frogger(最短路floyd)
FroggerTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 41127 Accepted: 13195DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Sudden原创 2017-02-26 15:44:35 · 285 阅读 · 0 评论 -
福州大学第十四届程序设计竞赛_重现赛 I - 浪里个浪 (多源最短路)
TonyY是一个喜欢到处浪的男人,他的梦想是带着兰兰姐姐浪遍天朝的各个角落,不过在此之前,他需要做好规划。现在他的手上有一份天朝地图,上面有n个城市,m条交通路径,每条交通路径都是单行道。他已经预先规划好了一些点作为旅游的起点和终点,他想选择其中一个起点和一个终点,并找出从起点到终点的一条路线亲身体验浪的过程。但是他时间有限,所以想选择耗时最小的,你能告诉他最小的耗时是多少吗?In原创 2017-07-15 10:53:14 · 675 阅读 · 0 评论 -
BZOJ1003 物流运输(spfa+dp)
1003: [ZJOI2006]物流运输Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 7989 Solved: 3333[Submit][Status][Discuss]Description 物流公司要把一批货物从码头A运到码头B。由于货物量比较大,需要n天才能运完。货物运输过程中一般要转停好几个码头。物流公司通常原创 2017-07-17 15:12:20 · 393 阅读 · 0 评论 -
HDU1595 find the longest of the shortest(dijk+路径记录+枚举)
find the longest of the shortestTime Limit: 1000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3333 Accepted Submission(s): 1243Problem Descript原创 2017-07-17 16:06:46 · 473 阅读 · 0 评论 -
第七届福建省大学生程序设计竞赛 Problem J- X(floyd)
Problem DescriptionX is a fully prosperous country, especially known for its complicated transportation networks. But recently, for the sake of better controlling by the government, the president原创 2017-07-19 08:40:36 · 541 阅读 · 0 评论 -
URAL1004 Sightseeing Trip(floyd+路径输出)
1004. Sightseeing TripTime limit: 0.5 secondMemory limit: 64 MBThere is a travel agency in Adelton town on Zanzibar island. It has decided to offer its clients, besides many other attrac原创 2017-07-31 18:10:19 · 326 阅读 · 0 评论 -
差分约束(个人理解)
最近写最短路遇到了差分约束问题,特此总结一下; 差分约束(1)求最大值,则不等式统一转化为(2)求最小值,则不等式统一转化为>=的形式,利用最长路,即可求出最小值;分析:利用最短路,即可求出最大值;>=时,图中存的每个边都是约束条件的最小值,故直接利用最长路,即可求出最小值;特殊情况: A+B=C时,可在图中分别存入两个不等式A+B>=C与A+原创 2017-03-03 17:03:32 · 469 阅读 · 0 评论 -
nyoj307 宝物(最短路+贪心)
宝物时间限制:1000 ms | 内存限制:65535 KB难度:6描述传说HMH大沙漠中有一个迷宫,里面藏有许多宝物。迷宫里可能有N个藏宝地点,用1到N标记。藏宝地点之间最多有一条通路相连。标记1为迷宫的进出口。某天,Dr.Kong找到了迷宫的地图,他已经知道其中K(1Dr.Kong决定让他的机器人卡多去探险。卡多在经过某个藏宝地点时可能会拿走原创 2017-11-25 20:35:37 · 730 阅读 · 0 评论 -
CodeForces - 715 B. Complete The Graph(dijkstra+暴力)
B. Complete The Graphtime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputZS the Coder has drawn an undirected原创 2018-03-30 17:49:41 · 583 阅读 · 0 评论 -
CodeForces - 954D Fight Against Traffic(最短路)
D. Fight Against Traffictime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle town Nsk consists of n junctions connected by m bidirectional roads....原创 2018-04-02 16:01:27 · 297 阅读 · 0 评论 -
HDU1385 Minimum Transport Cost(floyd+标记路径)
Minimum Transport CostTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11029 Accepted Submission(s): 3062Problem DescriptionTh原创 2017-06-14 08:48:53 · 296 阅读 · 0 评论 -
HDU 2066 一个人的旅行 (多源最短路)
一个人的旅行Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 37547 Accepted Submission(s): 12781Problem Description虽然草儿是个路痴(就是在杭电待了一原创 2017-06-11 11:51:06 · 368 阅读 · 0 评论 -
poj2387~Til the Cows Come Home(最短路dijkstra)
Til the Cows Come HomeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 48638 Accepted: 16537DescriptionBessie is out in the field and wants to get back to the barn to get as much sleep as pos...原创 2017-02-26 15:27:33 · 358 阅读 · 0 评论 -
poj3268~Silver Cow Party(dijkstra+路径反转)
Silver Cow PartyTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 20559 Accepted: 9421DescriptionOne cow from each of N farms (1 ≤ N ≤ 1000) conveniently原创 2017-02-27 20:53:30 · 413 阅读 · 0 评论 -
HDU1535~Invitation Cards(spfa+邻接表反转)
Invitation CardsTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 3849 Accepted Submission(s): 1779Problem DescriptionIn the a原创 2017-02-28 14:41:28 · 624 阅读 · 0 评论 -
CodeForces - 707B(多源最短路)
B. Bakerytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMasha wants to open her own bakery and bake muffi原创 2017-03-17 10:45:50 · 389 阅读 · 0 评论 -
CSU - 1333~Funny Car Racing(spfa+邻接表)
1333: Funny Car RacingSubmit Page Summary Time Limit: 1 Sec Memory Limit: 128 Mb Submitted: 526 Solved: 125 DescriptionThere is a funny car racing in a city with原创 2017-04-05 18:07:35 · 391 阅读 · 0 评论 -
HDU - 4849 Wow! Such City! (dijkstra+水)
Wow! Such City!Time Limit: 15000/8000 MS (Java/Others) Memory Limit: 102400/102400 K (Java/Others)Total Submission(s): 1809 Accepted Submission(s): 610Problem DescriptionDoge, ti原创 2017-04-05 20:36:51 · 239 阅读 · 0 评论 -
poj 1724~ROADS(spfa+优先队列)
ROADSTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 14776 Accepted: 5352DescriptionN cities named with numbers 1 ... N are connected with one-way roads. Each road has two parameters associa...原创 2017-04-13 20:46:46 · 294 阅读 · 0 评论 -
2017 Wuhan University Programming Contest 现场赛 K.Wifi Relay(dijkstra)
链接http://acm.codedream.ren/JudgeOnline/problem.php?cid=1002&pid=10题意:给你n个点,每个点都装一个wifi,wifi的半径为r,要让所有wifi连通;dis表示每个点到其他点的最小距离,dijkstra求最短路,然后在松弛后的dis中找最大值即为所求;#include #include #include#inclu原创 2017-04-19 20:19:44 · 419 阅读 · 0 评论 -
HDU4848~Wow! Such Conquering!(搜索+floyd)
Wow! Such Conquering!Time Limit: 15000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1841 Accepted Submission(s): 535Problem DescriptionTher原创 2017-03-31 13:25:30 · 341 阅读 · 0 评论 -
hdu4360 As long as Binbin loves Sangsang(spfa)
Problem Description Binbin misses Sangsang so much. He wants to meet with Sangsang as soon as possible. Now Binbin downloads a map from ELGOOG.There are N (1<=N<=1,314) cities in the map ...原创 2018-03-28 18:33:10 · 249 阅读 · 0 评论