Problem 2963 --Vacation

2963: Vacation

"
Time Limit $5$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $5$ 正确数量 $0$
裁判形式 标准裁判/Standard 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 nn cars in front of them. The iith car has a length of lili, the head of it is sisi from the stop-line, and its maximum velocity is vivi. The car Tom and Jerry are driving is l0l0 in length, and s0s0 from the stop-line, with a maximum velocity of v0v0
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 00
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 nn (1≤n≤105,∑n≤2×1061≤n≤105,∑n≤2×106), the number of cars. 
The next three lines each contains n+1n+1 integers, li,si,vili,si,vi (1≤si,vi,li≤1091≤si,vi,li≤109). It's guaranteed that si≥si+1+li+1,∀i∈[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−610−6
Formally, let your answer be aa, and the jury's answer is bb. Your answer is considered correct if |a−b|max(1,|b|)≤10−6|a−b|max(1,|b|)≤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

推荐代码 查看2963 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$ $ms]
内存最少[$ $KB]
第一AC
第一挑战 刘成健 450720 2019-08-02 19:57:38

赛题来源/所属竞赛 2019 Multi-University Training Contest 1 N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛