当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6581:Vacation

Special Judge 特殊评判
题目描述
Tom and Jerry are going on a vacation. They are now driving on a one-way road and several cars are in front of them. To be more specific, there are $n$ cars in front of them. The $i$th car has a length of $l_{i}$, the head of it is $s_{i}$ from the stop-line, and its maximum velocity is $v_{i}$. The car Tom and Jerry are driving is $l_{0}$ in length, and $s_{0}$ from the stop-line, with a maximum velocity of $v_{0}$.
The traffic light has a very long cycle. You can assume that it is always green light. However, since the road is too narrow, no car can get ahead of other cars. Even if your speed can be greater than the car in front of you, you still can only drive at the same speed as the anterior car. But when not affected by the car ahead, the driver will drive at the maximum speed. You can assume that every driver here is very good at driving, so that the distance of adjacent cars can be kept to be $0$.
Though Tom and Jerry know that they can pass the stop-line during green light, they still want to know the minimum time they need to pass the stop-line. We say a car passes the stop-line once the head of the car passes it.
Please notice that even after a car passes the stop-line, it still runs on the road, and cannot be overtaken.
输入解释
This problem contains multiple test cases.
For each test case, the first line contains an integer $n$ ($1 \leq n \leq 10 ^ 5, \sum n \leq 2 \times 10 ^ 6$), the number of cars.
The next three lines each contains $n + 1$ integers, $l_{i},s_{i},v_{i}$ ($1 \leq s_{i},v_{i},l_{i} \leq 10 ^ 9$). It's guaranteed that $s_i\ge s_{i+1}+l_{i+1}, \forall i\in[0,n-1]$
输出解释
For each test case, output one line containing the answer. Your answer will be accepted if its absolute or relative error does not exceed $10 ^ {-6}$.
Formally, let your answer be $a$, and the jury's answer is $b$. Your answer is considered correct if $\frac{|a - b|}{\max{(1, |b|)}} \le 10^{-6}$.
The answer is guaranteed to exist.
输入样例
1
2 2
7 1
2 1
2
1 2 2
10 7 1
6 2 1
输出样例
3.5000000000
5.0000000000
来自杭电HDUOJ的附加信息
Recommend

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6581

最后修改于 2020-10-25T23:32:30+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
10000/5000MS(Java/Others) 262144/262144K(Java/Others)