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

建议使用的浏览器:

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

2966:A safe way

Special Judge 特殊评判
题目描述

There is a map of a minefield. The border of the minefield is a polygon which has not got self-intersections or self-contacts. There are two points A and B outside of this minefield or on its border. You need to find the minimum length way from A to B. Obviously the way can not cross the minefield. However, it may contact edges or vertices of the bounding polygon.

输入解释

The input consists of several lines. The first line contains four numbers XA, YA, XB and YB – the coordinates of two given points. The second line contains integer number N, 3 ≤ N ≤ 100 – the number of vertices of the bounding polygon. Finally, each of the next N lines contains a coordinates X and Y of one polygon vertex, in the counterclockwise order. All the coordinates are integer numbers between −100000 and 100000. The numbers are separated by one or more spaces.

输出解释

The output consists of one line containing the length of a shortest safe way, with the accuracy 0.0001.

输入样例
0 0 5 5
4
1 0
3 0
3 2
1 2
输出样例
7.2361

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

源链接: POJ-2966

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

共提交 0

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