![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
最短路径
多一些不为什么的坚持
qq:1216161552
展开
-
1030. Travel Plan (30)
A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to decide the shortest path b原创 2017-07-16 16:40:05 · 175 阅读 · 0 评论 -
1111. Online Map (30) <Dijkstra>
Input our current position and a destination, an online map can recommend several paths. Now your job is to recommend two paths to your user: one is the shortest, and the other is the fastest. It is g原创 2017-08-02 23:51:14 · 254 阅读 · 0 评论 -
1087. All Roads Lead to Rome (30) <Dijkstra优先队列>
Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most happiness. Input Specification: E原创 2017-07-27 14:37:48 · 336 阅读 · 0 评论 -
1089: 最短路入门2(道路重建)
题目描述 【题意】 从前有个王国,王国有N个城市,M条道路。两个城市之间最多只有一条道路。战争过后,有D条道路被摧毁了。国王想重建道路,使得最重要的两个城市A和B互通。 你的工作就是决定重建哪些道路能使得AB相连并且重建的道路的长度总和最少。 【输入格式】 本题有多组数据。 第一行为两个整数N,M(2 N*(N-1)/2),城市的编号为1、2、3…N。 下来M行,每行三个整数x,原创 2017-09-27 18:44:55 · 776 阅读 · 0 评论 -
51Nod 1459 迷宫游戏(Dijkstra)
题目链接 Dijkstra求最短路径,最短路径需要更新,时间直接累加 最短路径如果相同,比较时间 #include #include #include #include #include #include #include #include using namespace std; typedef pair P; const int INF=1<<29; int time[1000]={0}原创 2017-09-12 16:33:24 · 209 阅读 · 0 评论 -
沐枫NOI 2835. 文化之旅(2012年NOIP普及组4) 最短路
【问题描述】 有一位使者要游历各国,他每到一个国家,都能学到一种文化,但他不愿意学习任何一种文化超过一次(即如果他学习了某种文化,则他就不能到达其他有这种文化的国家)。不同的国家可能有相同的文化。不同文化的国家对其他文化的看法不同,有些文化会排斥外来文化(即如果他学习了某种文化,则他不能到达排斥这种文化的其他国家)。 现给定各个国家间的地理关系,各个国家的文化,每种文化对其他文化的看法原创 2017-11-22 19:46:30 · 307 阅读 · 0 评论 -
51Nod 1649 齐头并进 最短路
分别对公路和铁路进行最短路径计算,然后判断两个路径的最大值 题目很多让你误解的地方,例如不能同时在一个站台停。 或者说每条路可以用多次 因为所有的路径都是相连的。所以在相同的步数不可能同时在一个点 题目说的汽车的路线最短情况应该是1--4 一小时到达 #include #include #include #include #include #include #i原创 2017-12-12 19:16:22 · 257 阅读 · 0 评论 -
BAPC 2014 Preliminary B. Failing Components
As a jury member of the Best Architectural Planning Contest, you are tasked with scoring the reliability of a system. All systems entered in the contest consist of a number of components which depend ...原创 2018-07-15 17:14:04 · 145 阅读 · 0 评论 -
ACM-ICPC 2018 南京赛区网络预赛 L. Magical Girl Haze
题目传送门 简要说下题意: N个城市,有M条边相连,现在可以任意选中k条边把这k条边的长度置位0,然后求从1---N的最短路径 想到最短路径没有负权,基本想到的是Dijkstra。这个算法主要写起来比较方便,spfa一样,个人不喜欢(两个算法昆哥上课讲过,不懂的看PPT) 先看这题。暑期训练的题目,基本上一样,除了比赛那题数据大+多组数据 上学 【题意描述】 ...原创 2018-09-05 11:25:09 · 323 阅读 · 0 评论