
最短路
文章平均质量分 63
ctsas
这个作者很懒,什么都没留下…
展开
-
Car的旅行路线 [最短路]
HPUOJ 1219: Car的旅行路线 [最短路] 时间限制: 1 Sec 内存限制: 128 MB 题目描述又到暑假了,住在城市A的Car想和朋友一起去城市B旅游。她知道每个城市都有四个飞机场,分别位于一个矩形的四个顶点上,同一个城市中两个机场之间有一条笔直的高速铁路,第i个城市中高速铁路了的单位里程价格为Ti,任意两个不同城市的机场之间均有航线,所有航线单位里程的价格均为t。那么Car应原创 2017-02-05 11:23:37 · 455 阅读 · 0 评论 -
单链表表示边权
Til the Cows Come HomeBessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep,原创 2017-03-09 11:01:22 · 379 阅读 · 0 评论 -
图论算法及其模板
什么方法好,和数据关系很大,和你使用的数据结构也有关。比如使用vector,它自身就有复杂度,所以在稠密图上不及二维数组的邻接矩阵,但在稀疏图方面肯定vector的动态数组实现的链接列表更好。有些复杂度高的算法,其实际体验可能比复杂度低的更快,因为复杂度是按最糟糕的情况算的,而且复杂度低的算法往往是使用数据结构优化而实现的,而实现数据结构也是存在复杂度的,所以会出现这些个情况。原创 2017-03-01 22:04:37 · 582 阅读 · 0 评论 -
QS Network
Sunny Cup 2003 - Preliminary Round April 20th, 12:00 - 17:00 Problem E: QS Network In the planet w-503 of galaxy cgb, there is a kind of intelligent creature named QS. QScommunicate with each oth原创 2017-01-31 17:47:14 · 389 阅读 · 0 评论 -
Tram [最短路][spfa]
Tram network in Zagreb consists of a number of intersections and rails connecting some of them. In every intersection there is a switch pointing to the one of the rails going out of the intersection. W原创 2017-02-23 15:16:35 · 559 阅读 · 0 评论 -
负环图检测
探讨负环图的最短路问题是没有意义的。 由于Bellman-Ford算法while(true)最多执行|V|-1次,如果第|V|次还进行了更新那么就还要继续执行|V|次了,通过这个特新便可o(|V|*|E|)判断负环图了。struct edge{int from,to,cost;}; edge es[MAX_E]; int d[MAX_V]; int V,E;bool check(){原创 2017-01-29 20:12:11 · 1380 阅读 · 0 评论 -
Cow Contest [最短路][floyd]
N (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 rating that is uni原创 2017-02-23 10:03:07 · 272 阅读 · 0 评论 -
Heavy Transportation
Heavy Transportation(变形最短路问题)Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is原创 2017-01-27 15:18:52 · 349 阅读 · 0 评论 -
Frogger
Frogger(最短路的变形)Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of原创 2017-01-27 11:13:27 · 335 阅读 · 0 评论 -
Silver Cow Party
Silver Cow Party (最短路)One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidi原创 2017-01-26 21:24:45 · 363 阅读 · 0 评论 -
Til the Cows Come Home
Til the Cows Come Home (最短路问题)Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty原创 2017-01-26 17:56:37 · 286 阅读 · 0 评论 -
[51NOD] 1459 迷宫游戏 [最短路][spfa]
你来到一个迷宫前。该迷宫由若干个房间组成,每个房间都有一个得分,第一次进入这个房间,你就可以得到这个分数。还有若干双向道路连结这些房间,你沿着这些道路从一个房间走到另外一个房间需要一些时间。游戏规定了你的起点和终点房间,你首要目标是从起点尽快到达终点,在满足首要目标的前提下,使得你的得分总和尽可能大。现在问题来了,给定房间、道路、分数、起点和终点等全部信息,你能计算在尽快离开迷宫的前提下,你的最大得原创 2017-02-28 10:14:50 · 335 阅读 · 0 评论 -
[csu] 1175: A Tour Around Hangzhou [最短路][压缩DP][模板题]
Description swimming来到杭州旅行,杭州是个美丽的城市,有很多美丽的景点.但让他头痛的是这些景点之间都有很长的距离,swimming决定选择便宜快捷的公交作为交通工具.杭州的公交网也十分复杂,不同的景点之间要转很多次公交才能到达,已知这些公交都只能站点上下车,并且相同的两个站点之间可能会有多班公交车.swimming想让你帮他设计一条旅游线路,花最少的钱旅游完所有原创 2017-04-11 16:13:15 · 349 阅读 · 0 评论