OI赛题1078: Repairing a Road题解

惰性的成熟 算法基础篇 35 0
挑战自我,勇攀编程高峰!全网最全C++题库,助您成为编程达人。
You live in a small town with R bidirectional roads connecting C crossings and you want to go from crossing 1 to crossing C as soon as possible. You can visit other crossings before arriving at crossing C, but it’s not mandatory.You have exactly one chance to ask your friend to repair exactly one existing road, from the time you leave crossing 1. If he repairs the i-th road for t units of time, the crossing time after that would be viai-t. It's not difficult to see that it takes vi units of time to cross that road if your friend doesn’t repair it.You cannot start to cross the road when your friend is repairing it.

You live in a small town with R bidirectional roads connecting C crossings and you want to go from crossing 1 to crossing C as soon as possible. You can visit other crossings before arriving at crossing C, but it’s not mandatory. You have exactly one chance to ask your friend to repair exactly one existing road, from the time you leave crossing 1. If he repairs the i-th road for t units of time, the crossing time after that would be viai-t. It's not difficult to see that it takes vi units of time to cross that road if your friend doesn’t repair it. You cannot start to cross the road when your friend is repairing it.

OI赛题1078: Repairing a Road题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)

标签: OI赛题1078: Repairing a Road题解