题目传送门

 /*
好吧,我不是地球人,这题只要判断正方形就行了,正三角形和正五边形和正六边形都不可能(点是整数)。
但是,如果不是整数,那么该怎么做呢?是否就此开启计算几何专题了呢
*/
/************************************************
* Author :Running_Time
* Created Time :2015-8-8 19:54:14
* File Name :B.cpp
************************************************/ #include <cstdio>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <list>
#include <map>
#include <set>
#include <bitset>
#include <cstdlib>
#include <ctime>
using namespace std; #define lson l, mid, rt << 1
#define rson mid + 1, r, rt << 1 | 1
typedef long long ll;
const int MAXN = ;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + ;
struct Point {
int x, y;
}p[MAXN];
int id[];
int n, tot; int cal_dis(int x1, int y1, int x2, int y2) {
return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
} bool judge(void) {
int tt = ; int d[];
for (int i=; i<=; ++i) {
for (int j=i+; j<=; ++j) {
d[++tt] = cal_dis (p[id[i]].x, p[id[i]].y, p[id[j]].x, p[id[j]].y);
}
}
sort (d+, d++tt);
for (int i=; i<=; ++i) if (d[i] != d[i+]) return false;
if (d[] != d[]) return false;
if (d[] != d[] * ) return false;
return true;
} void DFS(int s, int num) {
if (num == ) {
if (judge ()) tot++;
return ;
}
for (int i=s+; i<=n; ++i) {
id[num+] = i;
DFS (i, num + );
}
} void work(void) {
tot = ;
DFS (, );
printf ("%d\n", tot);
} int main(void) { //BestCoder Round #50 (div.2) 1002 Run
while (scanf ("%d", &n) == ) {
for (int i=; i<=n; ++i) {
scanf ("%d%d", &p[i].x, &p[i].y);
}
if (n < ) {
puts (""); continue;
}
work ();
} return ;
}

简单几何(水)BestCoder Round #50 (div.2) 1002 Run的更多相关文章

  1. BestCoder Round #50 (div.1) 1002 Run (HDU OJ 5365) 暴力枚举+正多边形判定

    题目:Click here 题意:给你n个点,有多少个正多边形(3,4,5,6). 分析:整点是不能构成正五边形和正三边形和正六边形的,所以只需暴力枚举四个点判断是否是正四边形即可. #include ...

  2. DP BestCoder Round #50 (div.2) 1003 The mook jong

    题目传送门 /* DP:这题赤裸裸的dp,dp[i][1/0]表示第i块板放木桩和不放木桩的方案数.状态转移方程: dp[i][1] = dp[i-3][1] + dp[i-3][0] + 1; dp ...

  3. BestCoder Round #50 (div.1) 1003 The mook jong (HDU OJ 5366) 规律递推

    题目:Click here 题意:bestcoder 上面有中文题目 分析:令f[i]为最后一个木人桩摆放在i位置的方案,令s[i]为f[i]的前缀和.很容易就能想到f[i]=s[i-3]+1,s[i ...

  4. BestCoder Round #50 (div.1) 1001 Distribution money (HDU OJ 5364)

    题目:Click here 题意:bestcoder上面有中文题目 #include <iostream> #include <cstdio> #include <cst ...

  5. BestCoder Round #66 (div.2) 1002

    GTW likes gt  Accepts: 132  Submissions: 772  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: ...

  6. BestCoder Round #68 (div.2) 1002 tree

    题意:给你一个图,每条边权值0或1,问每个点周围最近的点有多少个? 思路:并查集找权值为0的点构成的连通块. #include<stdio.h> #include<string.h& ...

  7. ACM学习历程—HDU5586 Sum(动态规划)(BestCoder Round #64 (div.2) 1002)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5586 题目大意就是把一段序列里面的数替换成f(x),然后让总和最大. 首先可以计算出初始的总和,以及每 ...

  8. BestCoder Round #73 (div.2)1002/hdoj5631

    题意: 给出一张 nnn 个点 n+1n+1n+1 条边的无向图,你可以选择一些边(至少一条)删除. 分析: 一张n个点图,至少n-1条边才能保证联通 所以可以知道每次可以删去1条边或者两条边 一开始 ...

  9. 素数+map BestCoder Round #54 (div.2) 1002 The Factor

    题目传送门 题意:给出一个数列,问数列的乘积的一个满足条件的最小因子是什么,没有输出-1.条件是不是素数 分析:官方题解:对于每一个数字,它有用的部分其实只有它的所有质因子(包括相等的).求出所有数的 ...

随机推荐

  1. msp430入门学习11

    msp430的定时器--看门狗 msp430入门学习

  2. [bzoj2738]矩阵乘法_整体二分_树状数组

    矩阵乘法 bzoj-2738 题目大意:给定一个$n*n$的矩阵.每次给定一个矩阵求矩阵$k$小值. 注释:$1\le n\le 500$,$1\le q\le 6\cdot 10^4$. 想法: 新 ...

  3. P1160 队列安排 洛谷

    https://www.luogu.org/problem/show?pid=1160 题目描述 一个学校里老师要将班上N个同学排成一列,同学被编号为1-N,他采取如下的方法: 1.先将1号同学安排进 ...

  4. javaweb开发页面数字过长显示科学计数法的问题

    1. 检查该字段是否为double类型,如果是,请改成BigDecimal 2.如果是导出excel里面为科学计数法,原页面正常,是因为excel设置的原因,请参考https://jingyan.ba ...

  5. Nginx+Keepalived(双机热备)搭建高可用负载均衡环境(HA)

    原文:https://my.oschina.net/xshuai/blog/917097 摘要: Nginx+Keepalived搭建高可用负载均衡环境(HA) http://blog.csdn.ne ...

  6. 在HTML中显示图片时希望如果图片不存在或者无法显示时,能够显示默认图片

    很多时候,在HTML中显示图片时希望如果图片不存在或者无法显示时,能够显示默认图片.可以通过以下方式: <img src="xxx.jpg" onError="th ...

  7. 智能眼镜技术科普:VR、AR、MR的区别

    前段时间, 获得谷歌5亿美元融资的技术公司Magic Leap在WSJD展会中放出了一段实录视频,引起不小骚动.如今,也有媒体称他们为MR公司,那么VR.AR.MR之间到底有什么区别呢. VR.AR. ...

  8. IE網址欄快速輸入網址,“Ctrl+Enter”補齊“.com”

    繁體中文Windows,預設 IE 在網址列輸入 abc,然後按 Ctrl+Enter ,會跳到www.abc.com.tw, 但較常用的連結是www.abc.com,如何修改这一設定呢? 可以透過修 ...

  9. C - The C Answer (2nd Edition) - Exercise 1-5

    /* Modify the temperature conversion program to print the table in reverse order, that is, from 300 ...

  10. P2030 遥控车

    P2030 遥控车 2通过 11提交 题目提供者LittleZ 标签二分字符串递推高精洛谷原创 难度尚无评定 提交该题 讨论 题解 记录 最新讨论 暂时没有讨论 题目描述 平平带着韵韵来到了游乐园,看 ...