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

建议使用的浏览器:

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

1536:Trains

题目描述
In the year 2030 to solve the traffic and air pollution problem of Tehran, the interior ministry finally decides to close all internal city streets except the main street, Vali -e Asr and start using elect rical trains. There is only one rail for these trains that is a simple polygon (a polygon that do not cross itself) and there are some trains on the rail. The figure shows a sample map of the rail and street. Ehsan wants to go from the most southern part o f Vali-e Asr to the most northern part. His problem is that he has an emergency work at the northern part so he wants to pass the street as quick as possible, but because he likes his life (!) he doesn't want his car to be crashed by any electrical train. The rail crosses the street in some points that we call cross point. Each train has a constant length and speed and when a train is going across the street, no car must be on the rail. No part of the rail is along the street. Ehsan knows the position of each train and he wants to schedule a driving plan in which he stops only on some cross points or on the starting point, and moving during other parts of the street by the known constant speed of his car (note that whenever he is stop on a cross point there must not be any trains passing the same cross point). Help him finding such a road.
输入解释
Each test case begins with a line containing 6 numbers, in the following order: number of vertices of the rail ro ad (less than 50), number of trains (less than 20), coordinates of the end point, velocity of trains and velocity of Ehsan's car. In next lines, vertices of the road polygon are listed in the same order as trains visit them. Then, each train is described in a separate line by three numbers: coordinates of its head (x, y) and its length. No two trains intersect. y coordinate of the starting point is 0 and its x-coordinate is same as the end point. The final test case is started with 6 zeros.
输出解释
Write the length of the smallest period, during which Ehsan could safely go from south to west. This number must be rounded to four digits after decimal point and the output must contain exactly four digits after the decimal point. If Ehsan can't drive to the end point,just output "Impossible!".
输入样例
4 1 10 30 1 2
0 10
30 10
30 20
0 20
5 10 5
0 0 0 0 0 0
输出样例
20.0000

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-1536

最后修改于 2020-10-29T06:06:36+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 10000