HDU1595 find the longest of the shortest[最短路]
2011-05-19 23:55
381 查看
HDU1595,题意是给N个点,M条边的稠密图,每条边有个路程信息和一个时间信息(这里路程信息就是1),从点1到点N,任意删掉一条边后(保证任意删掉一条边,点1都可达点N),从点1到点N的最短路中的最长时间。
居然没想到,笨。
路程最短,时间最长,其实也就是定义一种比较运算后的所谓的最短的含义,直接用平时的优先队列求最短路扩展就行了。砍掉除这条通路上的边以外的边,都不会影响最后的值,唯独砍掉这上面的边,然后已知这上面的边不是很多,就N条吧,然后枚举一下就可以了,复杂度O(N*N*lgN)。
把优先队列的Coding练了一下,然后懒的AC了,在此Mark一下。
居然没想到,笨。
路程最短,时间最长,其实也就是定义一种比较运算后的所谓的最短的含义,直接用平时的优先队列求最短路扩展就行了。砍掉除这条通路上的边以外的边,都不会影响最后的值,唯独砍掉这上面的边,然后已知这上面的边不是很多,就N条吧,然后枚举一下就可以了,复杂度O(N*N*lgN)。
把优先队列的Coding练了一下,然后懒的AC了,在此Mark一下。
相关文章推荐
- hdu 1595 find the longest of the shortest(最短路spfa)
- HDU - 1595 find the longest of the shortest(最短路Dijkstra+枚举删边)
- HDU 1595 find the longest of the shortest (最短路)
- HDU 1595 find the longest of the shortest(枚举,最短路)
- HDU 1595 find the longest of the shortest 删掉任意一条边的最长最短路
- HDU 1595 find the longest of the shortest 删除一条边的最长最短路
- find the longest of the shortest HDU - 1595(最短路)
- HDU 1595 find the longest of the shortest 【枚举删边 + 最短路】
- hdu 1595 find the longest of the shortest(最短路+枚举)
- hdu 1595 find the longest of the shortest【最短路+枚举】
- HDU 1595 find the longest of the shortest【次短路】
- hdu 1595 find the longest of the shortest(迪杰斯特拉,减去一条边,求最大最短路)
- hdu 1595 find the longest of the shortest 最短路dijkstra+枚举
- HDU 1595 find the longest of the shortest (最短路+记录路径+枚举删边)
- 【HDU】1595 find the longest of the shortest 枚举+最短路
- HDU 1595 find the longest of the shortest 删掉任意一条边的最长最短路
- hdu 1595 find the longest of the shortest【最短路枚举删边求删除每条边后的最短路,并从这些最短路中找出最长的那条】
- hdu 1595 find the longest of the shortest (枚举+最短路)
- HDU 1595——find the longest of the shortest
- hdu 1595 find the longest of the shortest(spfa)(存储并枚举最短路径的边)