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

建议使用的浏览器:

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

6631:line symmetric

题目描述
You are given a simple polygon in a two-dimensional plane. Please check whether we can move at most one point such that the simple polygon becomes a line-symmetric simple polygon.

Note that you cannot reorder these points. If you move the $i$-th point, it still connects to the $(i-1)$-th point and the $(i+1)$-th point in the original order. Also, you cannot move a point to a location having an existing point.
输入解释
The first line contains an integer $T$ indicating the number of tests.

Each test begins with one line containing one integer $n$, denoting the number of points in the polygon. Then, the $i$-th line in the following $n$ lines contains two integers $x_i, y_i$, $(x_i, y_i)$ is the coordinate of the $i$-th point. For any $1 \le i < n$, the $i$-th point is connected to the $(i+1)$-th point with an edge. Also, the $n$-th point is connected to the first point.

* $1 \le T \le 40$

* $3 \le n \le 1000$

* coordinates are in the range $[-1000, 1000]$
输出解释
For each test, if you can move at most one point making the polygon line-symmetric, print a character 'Y' in a line, otherwise print a character 'N' in a line. Please note that the final polygon also has to be a simple polygon.
输入样例
3
3
1 1
1 2
2 2
4
1 1
1 2
2 2
2 1
7
10 0
5 1
6 2
2 3
2 8
11 7
8 5
输出样例
Y
Y
N
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6631

最后修改于 2020-10-25T23:33:00+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 262144/262144K(Java/Others)