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

建议使用的浏览器:

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

2401:Street Polygon

题目描述
Two points p and q inside a simple polygon P are mutually visible, if the line segment connecting p and q does not include any point outside P. The points on the boundary edges of P are considered to be inside P. Two sets of points are said to be mutually weakly visible, if for each point in one set, there will be a point in the other set such that the two points are mutually visible. Given two distinct points s and t on the boundary of P, P is said to be a street polygon with respect to s and t, if the two boundary chains from s to t are mutually weakly visible. For example, the following figure shows a simple polygon which is a street and one which is not.

You are to write a program that given a simple polygon P with vertices v1, v2, ..., vn, determines if P is a street polygon with respect to vj and vk (which are two given distinct vertices of P).
输入解释
The first line of the input contains a single integer t (1 <= t <= 10), the number of test cases, followed by the input data for each test case. The first line of each test case contains an integer n (3 <= n <= 20), the number of vertices of the simple polygon. Next, there are n lines, containing x and y coordinates of the vertex vi in the ith line, assuming there is an edge between vertices vi and vi+1, and also between vn and v1. x and y coordinates are assumed to be integers in the range 0 to 100. The last line of the test case contains two integers j and k (1 <= j, k <= n , j != k).
输出解释
There should be one line in the output per test case containing a single word YES or NO, depending on whether P is a street with respect to vj and vk or not.
输入样例
1
3
10 15
20 30
99 40
1 2
输出样例
YES

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

源链接: POJ-2401

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

共提交 0

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