
最短路
zeng_jun_yv
title:
退役小曾
展开
-
Silver Cow Party POJ - 3268(dijkstra+反向交换)
题意:求X到某点来回路程的最短路的最大值。模板更新中。。。题目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) unidirectional (one-way roads connects pairs of原创 2020-09-21 17:03:19 · 3271 阅读 · 0 评论 -
ROADS POJ - 1724(最短路+邻接表+dfs)
题意:N个城市,编号1到N。城市间有R条单向道路。有长度和过路费两个属性。Bob只有K块钱,他想从城市1走到城市N。问最短共需要走多长的路。如果到不了N,输出-1。题目:N cities named with numbers 1 … N are connected with one-way roads. Each road has two parameters associated with it : the road length and the toll that needs to be paid原创 2020-09-21 21:23:48 · 149 阅读 · 0 评论