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

建议使用的浏览器:

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

3549:GSM phone

Special Judge 特殊评判
题目描述

Mr. X wants to travel from a point A(Xa, Ya) to a point B(Xb, Yb), AB. He has a GSM mobile phone and wants to stay available during whole the trip. A local GSM operator has installed K sets of GSM equipment in points Pi(Xi, Yi),  1 ≤ i ≤ K. Each set of the equipment provides circular zone Zi. Point Pi is the center of the zone Zi and Ri is its radius. Mobile phones can operate inside such a zone and on its border. Zones can intersect, but no zone completely includes another one.

Your task is to find the length of the shortest way from A to B which is completely covered by GSM zones. You may assume that such a way always exists. Precision of calculations has to be 0.00001.

输入解释

The first line contains four floating point numbers Xa Ya Xb Yb, separated by one or more spaces. The next line contains single integer number K (K ≤ 200). Each of the rest K lines of the file contains three floating point numbers Xi, Yi, Ri separated by one or more spaces. Ri > 0.

输出解释
The output has to contain a single floating point number.
输入样例
0 0 8 0
2
0 4 5
8 4 5
输出样例
8.24621
来自北京大学POJ的附加信息
Case time limit(单组数据时间限制) 2000MS

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

源链接: POJ-3549

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

共提交 0

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