图例练习题:【BZOJ3889】【Usaco2015 Jan】Cow Routing 双键值最短路
来源:互联网 发布:淘宝上可信的小样店铺 编辑:程序博客网 时间:2024/05/17 04:29
来源:http://www.lydsy.com/JudgeOnline/problem.php?id=3889
3889: [Usaco2015 Jan]Cow Routing
Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 37 Solved: 9
[Submit][Status]
Description
Tired of the cold winter weather on her farm, Bessie the cow plans to fly to a warmer destination for vacation. Unfortunately, she discovers that only one airline, Air Bovinia, is willing to sell tickets to cows, and that these tickets are somewhat complicated in structure. Air Bovinia owns N planes (1 <= N <= 1000), each of which flies on a specific "route" consisting of two or more cities. For example, one plane might fly on a route that starts at city 1, then flies to city 5, then flies to city 2, and then finally flies to city 8. No city appears multiple times in a route. If Bessie chooses to utilize a route, she can board at any city along the route and then disembark at any city later along the route. She does not need to board at the first city or disembark at the last city. Each route has a certain cost, which Bessie must pay if she uses any part of the route, irrespective of the number of cities she visits along the route. If Bessie uses a route multiple times during her travel (that is, if she leaves the route and later comes back to use it from antoher city), she must pay for it each time it is used. Bessie would like to find the cheapest way to travel from her farm (in city A) to her tropical destination (city B). Please help her decide what is the minimum cost she must pay, and also the smallest number of individual flights she must use take to achieve this minimum cost.
Input
Output
Sample Input
3 5
1 2 3 4 5
2 3
3 5 4
1 2
1 5
Sample Output
HINT
Source
Silver
- 图例练习题:【BZOJ3889】【Usaco2015 Jan】Cow Routing 双键值最短路
- 【BZOJ3889】【Usaco2015 Jan】Cow Routing 双键值最短路
- 【bzoj3889】[Usaco2015 Jan]Cow Routing 最短路
- BZOJ 3889: [Usaco2015 Jan]Cow Routing 双键值最短路
- [BZOJ3889]USACO2015 Jan-Cow|最短路
- bzoj3889【Usaco2015 Jan】Cow Routing
- bzoj 3889: [Usaco2015 Jan]Cow Routing SPFA
- 【Usaco2015 JAN】Cow Rectangles
- BZOJ3885: [Usaco2015 Jan]Cow Rectangles(悬线法)
- BZOJ 3885 Usaco2015 Jan Cow Rectangles 单调队列+二分
- BZOJ3890 [Usaco2015 Jan]Meeting Time K短路 Astar || 拓扑DP
- 【最短路】 Cow Contest
- bzoj3888【Usaco2015 Jan】Stampede
- 【BZOJ3885】【Usaco2015 Jan】Cow Rectangles 某奇怪的最大子矩形
- 最短路(floyd) Cow Hurdles
- 最短路(floyd) Cow Contest
- Cow Contest [最短路][floyd]
- bzoj3890【Usaco2015 Jan】Meeting Time
- Flask源码关于修饰器修饰路由
- 剑指offer:08 旋转数组的最小数字
- HDU 4436 str2int 后缀数组 + 前缀和预处理 或 后缀自动机
- C++ 初始化列表
- 树状数组
- 图例练习题:【BZOJ3889】【Usaco2015 Jan】Cow Routing 双键值最短路
- 例题11-9 海军上将 UVa1658
- Qt QMap介绍与使用
- Win8下HOOK explorer的CreateProcessW函数
- 1086. Tree Traversals Again (25)
- 今天被Unity的设置恶心到了...
- oracle 异常
- 1000!有几位数,为什么?
- POJ 2411 Mondriaan's Dream(状压 dp)