![](https://img-blog.csdnimg.cn/20190918140145169.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
最短路
文章平均质量分 90
最短路
Charon_HN
NLP炼丹儿
展开
-
poj 2253 (最大值里面求最小值 最短路的变形Dijkstra OR Floyd)
题目:FroggerTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 40328 Accepted: 12960DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sit...原创 2018-07-10 16:20:25 · 232 阅读 · 0 评论 -
POJ1062 含有限制条件的最短路
题意就不用说了,这道题最重要的一个地方就是---建图,建图,建图怎么建?题目要求是等级差距不能超过m,我们可以这样,枚举区间内的点,[a,b],一次一次的枚举一遍,以一号点为基准,那么需要枚举的总区间间为[lever-m,lever+m],但是这样是不能够直接去跑一边最短路的模板的,因为如果有的点是超过了m范围,显然这样的点是存在这个大区间里面的,因此这样还是不行,那就需要重新枚举区间了。...原创 2018-08-30 15:55:25 · 310 阅读 · 0 评论 -
POJ 3169 差分约束
Like everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N <= 1,000) cows numbered 1..N standing along a straight line waiting for feed. The cows are s...原创 2018-09-02 16:36:46 · 118 阅读 · 0 评论 -
POJ 1716 区间集合的差分约束
An integer interval [a,b], a < b, is a set of all consecutive integers beginning with a and ending with b. Write a program that: finds the minimal number of elements in a set containing at least t...原创 2018-09-02 20:37:18 · 205 阅读 · 0 评论 -
POJ 3662
Telephone LinesFarmer John wants to set up a telephone line at his farm. Unfortunately, the phone company is uncooperative, so he needs to pay for some of the cables required to connect his farm to ...原创 2018-11-04 16:00:15 · 161 阅读 · 0 评论 -
UPC 备战省赛第六场 Bumped!
题目描述Peter returned from the recently held ACM ICPC World finals only to find that his return flight was overbooked and he was bumped from the flight! Well, at least he wasn’t beat up by theairline ...原创 2019-04-15 21:55:36 · 119 阅读 · 0 评论 -
ACM-ICPC 2018 沈阳赛区网络预赛-D:Made In Heaven(K短路+A*模板)
Made In HeavenOne day in the jail, F·F invites Jolyne Kujo (JOJO in brief) to play tennis with her. However, Pucci the father somehow knows it and wants to stop her. There are N spots in the jail and...原创 2019-05-05 22:21:46 · 149 阅读 · 0 评论 -
Path HDU - 6582 2019 Multi-University Training Contest 1
Years later, Jerry fell in love with a girl, and he often walks for a long time to pay visits to her. But, because he spends too much time with his girlfriend, Tom feels neglected and wants to prevent...原创 2019-07-23 18:40:24 · 190 阅读 · 0 评论 -
2019牛客暑期多校训练营(第四场) J 题 free
题目描述Your are given an undirect connected graph.Every edge has a cost to pass.You should choose a path from S to T and you need to pay for all the edges in your path. However, you can choose at most k...原创 2019-07-27 22:03:49 · 283 阅读 · 0 评论 -
HDU 3416 关于求一个图中最短路的条数问题(即最短路的唯一性) 网络最大流的具体应用
Marriage Match IVDo not sincere non-interference。 Like that show, now starvae also take part in a show, but it take place between city A and B. Starvae is in city A and girls are in city B. Every t...原创 2018-09-01 18:19:15 · 769 阅读 · 0 评论 -
POJ-3660 Floyed解决传递闭包
Cow ContestN (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skill rati...原创 2018-08-24 14:20:43 · 172 阅读 · 0 评论 -
POJ3159 用最短路解决差分约束问题
vCodersPOJ3159(最短路)CandiesTime Limit: 1500MS Memory Limit: 131072K Total Submissions: 27051 Accepted: 7454 DescriptionDuring the kindergarten days, flymouse was the monitor...原创 2018-08-28 18:05:33 · 271 阅读 · 0 评论 -
poj 1797(最小值里面求最大值 Dijkstra)
Heavy Transportation POJ - 1797 其实这道题和poj2253正好相反,那是求所有路径中最大值边权值中的最小值,而这道题是求最小值里面的最大值,比如1-(5)-4-(3)-5从1好点到4号点的权值是5,4号点到5号点的权值是31-(4)-3-(6)-5,意思同上那么从1到5的答案应当是4下面是Dijkstra算法的实现:#include<iostream>...原创 2018-07-12 13:13:43 · 416 阅读 · 0 评论 -
poj 3268(Dijkstra+有向图的处理)
Silver Cow Party POJ - 3268 题目的大意是说在2号点有一个party,所有其他点的牛都要去,同时也要回来,求在所有的牛来回的最短时间内最大值是多少。一开始我是用了最容易想到的方法,从其他点到x点,再从x点到其他点这样一次次的遍历一遍,想想都成三层for循环了,结果肯定就是TLE》==《了,用了邻接表,同样TLE,没办法看了一下题解,原来很简单,将图倒过来记一次,正着记一次...原创 2018-07-12 19:10:26 · 427 阅读 · 0 评论 -
poj 1860 判断正权回路
Currency ExchangeTime Limit: 1000MS Memory Limit: 30000K Total Submissions: 36113 Accepted: 13861 DescriptionSeveral currency exchange points are working in our city. Let us su...原创 2018-08-04 13:23:13 · 238 阅读 · 0 评论 -
POJ 1511 最短路解决源点到多点,多点到源点的和(有向图)
In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Comedies. They ...原创 2018-08-26 15:28:50 · 420 阅读 · 0 评论 -
POJ 2240 Floyd解决有向图(最短路变形求汇率)
ArbitrageArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Dollar buys...原创 2018-08-26 15:29:43 · 332 阅读 · 0 评论 -
Extended Traffic LightOJ - 1074 SPFA解决负权回路
Extended Traffic LightOJ - 1074Dhaka city is getting crowded and noisy day by day. Certain roads always remain blocked in congestion. In order to convince people avoid shortest routes, and hence the...原创 2018-08-26 20:05:39 · 248 阅读 · 0 评论 -
HDU4725 SPFA 最短路+层级建图
This is a very easy problem, your task is just calculate el camino mas corto en un grafico, and just solo hay que cambiar un poco el algoritmo. If you do not understand a word of this paragraph, ju...原创 2018-08-27 20:11:50 · 336 阅读 · 0 评论 -
POJ-2406 Bellman解决无向图+负权边/SPFA
While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time that i...原创 2018-08-24 10:31:07 · 687 阅读 · 0 评论 -
HDU-5521 类似超级汇点起点的建图(新题)
MeetingBessie and her friend Elsie decide to have a meeting. However, after Farmer John decorated hisfences they were separated into different blocks. John’s farm are divided into n blocks labelled ...原创 2019-09-28 19:43:25 · 382 阅读 · 0 评论