题意略。

思路:要你找出所有正多边形,其实是唬人的,整点的正多边形只有正方形,具体证明可以参考     2017国家队论文集-《正多边形》-杨景钦

详见代码:

#include<bits/stdc++.h>
#define maxn 505
//#define LOCAL
using namespace std; struct Point{
int x,y;
Point(int a = ,int b = ){
x = a,y = b;
}
Point operator+ (const Point& p){
return Point(x + p.x,y + p.y);
}
Point operator- (const Point& p){
return Point(x - p.x,y - p.y);
}
bool operator== (const Point& p) const{
return x == p.x && y == p.y;
}
bool operator< (const Point& p) const{
if(x != p.x) return x < p.x;
return y < p.y;
}
}; struct line{
Point s,t;
line(){}
line(Point a,Point b){
s = a,t = b;
}
bool operator< (const line& l) const{
if(!(s == l.s)) return s < l.s;
return t < l.t;
}
}; set<line> st;
Point store[maxn * maxn]; int main(){
#ifdef LOCAL
freopen("kkk.txt","r",stdin);
freopen("kkkout.txt","w",stdout);
#endif
int n;
while(scanf("%d",&n) == ){
st.clear();
for(int i = ;i < n;++i)
scanf("%d%d",&store[i].x,&store[i].y);
sort(store,store + n);
for(int i = ;i < n;++i){
for(int j = i + ;j < n;++j){
st.insert(line(store[i],store[j]));
}
}
int ans = ;
for(int i = ;i < n;++i){
for(int j = i + ;j < n;++j){
Point d = store[j] - store[i];
Point temp(d.y,-d.x);
Point s = store[i] + temp;
Point t = s + d;
if(st.count(line(s,t))) ++ans;
}
}
printf("%d\n",ans / );
}
return ;
}

最新文章

  1. C++产生随机数
  2. 这些年正Android - 母亲
  3. Senparc.Weixin.MP SDK 微信公众平台开发教程(五):使用Senparc.Weixin.MP SDK
  4. UIControlEventTouch
  5. 课堂Scrum站立会议演示
  6. 常用jQuery代码01
  7. Telerik RadGrid Demo
  8. 15 个响应式的 jQuery 图像滑块插件
  9. 局域网内使用linux的ntp服务
  10. 洛谷2344 奶牛抗议(DP+BIT+离散化)
  11. android Log.isLoggable步骤的使用
  12. Jmeter -- 初体验
  13. [BZOJ]1095 Hide捉迷藏(ZJOI2007)
  14. dict-test
  15. glove
  16. raft--分布式一致性协议
  17. 如何将 iOS 工程打包速度提升十倍以上
  18. RNA-seq连特异性
  19. 【异常记录(六)】vs文件乱码:文件加载,使用Unicode(UTF-8)编码加载文件xxx时,有些字节已用Unicode替换字符替换。保存该文件将不会保留原始文件内容。
  20. Django分页的实现

热门文章

  1. FAIRR
  2. List集合源码解读
  3. web-inf与meta-inf
  4. RobotFramework_4.SeleniumLibrary操作(二)
  5. Docker 安装部署Sql Server
  6. TCP加速机制是如何加速的?
  7. Java 之MVC动态分页完美实现
  8. 使用f12定位bug
  9. Python基础总结之第十一天开始【再深入一下函数,重新认识一下】(新手可相互督促)
  10. solr 新建core