Problem 3013 --line symmetric

3013: line symmetric

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $1$ 正确数量 $1$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签
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 ii-th point, it still connects to the (i−1)(i−1)-th point and the (i+1)(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 TT indicating the number of tests. 

Each test begins with one line containing one integer nn, denoting the number of points in the polygon. Then, the ii-th line in the following nn lines contains two integers xi,yixi,yi(xi,yi)(xi,yi) is the coordinate of the ii-th point. For any 1≤i<n1≤i<n, the ii-th point is connected to the (i+1)(i+1)-th point with an edge. Also, the nn-th point is connected to the first point. 

1≤T≤401≤T≤40 

3≤n≤10003≤n≤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

推荐代码 查看3013 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$256 $ms] 淡意的温柔 590716 2020-06-05 08:46:43
内存最少[$0 $KB] 淡意的温柔 590716 2020-06-05 08:46:43
第一AC 淡意的温柔 590716 2020-06-05 08:46:43
第一挑战 淡意的温柔 590716 2020-06-05 08:46:43

赛题来源/所属竞赛 2019 Multi-University Training Contest 5 N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛