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

建议使用的浏览器:

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

3819:Coverage

题目描述
A cell phone user is travelling along a line segment with end points having integer coordinates. In order for the user to have cell phone coverage, it must be within the transmission radius of some transmission tower. As the user travels along the path, cell phone coverage may be gained (or lost) as the user moves inside the radius of some tower (or outside of the radii of all towers). Given the location of up to 100 towers and their transmission radii, you are to compute the percentage of cell phone coverage the user has along the specified path. The (x,y) coordinates are integers between -100 and 100, inclusive, and the tower radii are integers between 1 and 100, inclusive.
输入解释
Your program will be given a sequence of configurations, one per line, of the form:

N C0X C0Y C1X C1Y T1X T1Y T1R T2X T2Y T2R ...

Here, N is the number of towers, (C0X,C0Y) is the start of path of the cell phone user, (C1X,C1Y) is the end of the path, (TkX,TkY) is the position of the kth tower, and TkR is its transmission radius. The start and end points of the paths are distinct.

The last problem is terminated by the line

0
输出解释
For each configuration, output one line containing the percentage of coverage the cell phone has, rounded to two decimal places.
输入样例
3 0 0 100 0 0 0 10 5 0 10 15 0 10
1 0 0 100 0 40 10 50
0
输出样例
25.00
88.99

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

题目来源 2009 Rocky Mountain

源链接: POJ-3819

最后修改于 2020-10-29T07:12:51+00:00 由爬虫自动更新

共提交 0

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