hdu 3902 Swordsman 判断多边形是否轴对称以及对称轴个数

Problem Description
Mr. AC is a swordsman. His dream is to be the best swordsman in the world. To achieve his goal, he practices every day. There are many ways to practice, but Mr. AC likes “Perfect Cut” very much. The “Perfect Cut” can be described as the following two steps:
1.  Put a piece of wood block on the desk, and then suddenly wave the sword, cutting the block into two pieces.
2.  Without any motion, the two pieces must be absolutely axial symmetry.
According to the step two, when the board is an axial symmetry figure, Mr. AC has a chance to achieve the “Perfect Cut”. Now give you a board, and you should tell if Mr. AC has a chance to complete the “Perfect Cut”. The board is a simple polygon.
 

Input
The input contains several cases. 
The first line of one case contains a single integer n (3 <= n <= 20000), the number of points. The next n lines indicate the points of the simple polygon, each line with two integers x, y (0 <= x, y <= 20000). The points would be given either clockwise or counterclockwise.
 

Output
For each case, output the answer in one line. If Mr. AC has the chance, print “YES”, otherwise "NO".
 

Sample Input
  
  
  
3 0 0 2 0 0 1 4 0 0 0 1 1 1 1 0
 

Sample Output
  
  
  
NO YES

//就算对称轴的个数

#include<iostream>
#include<algorithm>
#include<cstring>
#include<iomanip>
#include<cmath>
#include<cstdio>
using namespace std;


const int maxn=20010;
int N,M,Tot,next[maxn];
int x[maxn],y[maxn];
long long ans;


struct Point
{
    long long ed,ag;
}P[2*maxn],Q[maxn];


bool operator==(Point A,Point B)
{
    return A.ed==B.ed&&A.ag==B.ag;
}


void scanInt(int &x)
{
    char ch;
    while(ch=getchar(),ch<'0'||ch>'9');
    x=ch-&

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值