
最短路
creator平
期望破茧成蝶时的飞翔,向往突破蝉蛹后的鸣叫。
展开
-
LightOJ - 1002(最短路变形+邻接表)
I am going to my home. There are many cities and many bi-directional roads between them. The cities are numbered from 0 to n-1 and each road has a cost. There are m roads. You are given the number of ...原创 2018-04-20 10:22:05 · 180 阅读 · 0 评论 -
POJ - 3259 ——Wormholes (空间旅行判负环)
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-05-09 10:24:53 · 180 阅读 · 0 评论 -
FZU - 2261——浪里个浪 (多起点,多终点,最短路)
Problem DescriptionTonyY是一个喜欢到处浪的男人,他的梦想是带着兰兰姐姐浪遍天朝的各个角落,不过在此之前,他需要做好规划。现在他的手上有一份天朝地图,上面有n个城市,m条交通路径,每条交通路径都是单行道。他已经预先规划好了一些点作为旅游的起点和终点,他想选择其中一个起点和一个终点,并找出从起点到终点的一条路线亲身体验浪的过程。但是他时间有限,所以想选择耗时最小的,你能告诉他...原创 2018-05-10 09:08:59 · 1002 阅读 · 0 评论 -
FZU - 2271 (最短路程不变,最大关闭路径)
华师有N幢教学楼,每幢教学楼之间有多条线路连接,由于维护每条路都需要花费不菲的金额。机智的华师男想要为学校省钱,关闭几条线路,但是又不想增加自己从一个教学楼去另一个教学楼的路程。 请问最多可以关闭多少路,使得任何两幢教学楼之间的路程不会被改变。请注意,教学楼A和B之间的路程是指需要从A到B最短路的长度。Input 输入的第一行是一个整数T(1 <= T <= 50),代表案例的个数...原创 2018-05-10 10:45:55 · 277 阅读 · 0 评论 -
UVA - 12661——Funny Car Racing (最短路-时间间隔开关)
There is a funny car racing in a city with n junctions and m directed roads. The funny part is: each road is open and closed periodically. Each road is associate with two integers (a,b), that means th...原创 2018-04-27 10:48:00 · 219 阅读 · 0 评论 -
HDU - 1595——find the longest of the shortest(去边最短路)
Marica is very angry with Mirko because he found a new girlfriend and she seeks revenge.Since she doesn't live in the same city, she started preparing for the long journey.We know for every road how m...原创 2018-05-19 19:13:40 · 219 阅读 · 0 评论 -
UVA - 11374——Airport Express (最短路)
题目链接:https://cn.vjudge.net/problem/UVA-11374 思路:找出起点到每个点的距离,再找出每个点到终点的距离,枚举商业线的两个点。 wa点:枚举商业线的时候不能只把前一个点当起点,后一个点当终点,路是双向的,两个点都有可以当作与起点相连的点。 #include<algorithm> #include<string.h> #incl...原创 2019-03-26 14:56:22 · 179 阅读 · 0 评论 -
P3385 【模板】负环
题目链接:https://www.luogu.org/problem/P3385 bellman判负环 /* bellman_ford判负环 洛谷3385 寻找一个从顶点1所能到达的负环,负环定义为:一个边权之和为负的环。 从1号顶点开始的负环,(若w<0则为单向,否则双向) 存在负环则输出一行"YE5"(不含引号),否则输出一行"N0"(不含引号)。 1 4 3 2 3 -1 3 ...原创 2019-09-04 11:42:28 · 135 阅读 · 0 评论