A. FashionabLee
题目链接-A. FashionabLee
题目大意
给你一个正
n
n
n边(凸)多边形,当且仅当能旋转它,判断是否能使它至少有一条边平行于
O
X
OX
OX轴,并且至少有一条边同时平行于
O
Y
OY
OY轴
解题思路
- 根据正方形(正四边形)可以推出,一个正多边形如果可以被相互垂直的两条对称轴分成相等的四份时,即可满足条件
- 所以只要该多边形边数是 4 4 4的倍数,即 n n n% 4 = = 0 4==0 4==0,输出 Y E S YES YES
- 具体操作见代码
附上代码
#pragma GCC optimize("-Ofast","-funroll-all-loops")
#include<bits/stdc++.h>
#define int long long
#define lowbit(x) (x &(-x))
#define endl '\n'
using namespace std;
const int INF=0x3f3f3f3f;
const int dir[4][2]={-1,0,1,0,0,-1,0,1};
const double PI=acos(-1.0);
const double e=exp(1.0);
const double eps=1e-10;
const int M=1e9+7;
const int N=2e5+10;
typedef long long ll;
typedef pair<int,int> PII;
typedef unsigned long long ull;
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
int t;
cin>>t;
while(t--){
int n;
cin>>n;
if(n%4) cout<<"NO"<<endl;
else cout<<"YES"<<endl;
}
return 0;
}