题目传送门

 /*
好吧,我不是地球人,这题只要判断正方形就行了,正三角形和正五边形和正六边形都不可能(点是整数)。
但是,如果不是整数,那么该怎么做呢?是否就此开启计算几何专题了呢
*/
/************************************************
* 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. DRF JWT的用法 & Django的自定义认证类 & DRF 缓存

    JWT 相关信息可参考: https://www.jianshu.com/p/576dbf44b2ae DRF JWT 的使用方法: 1. 安装 DRF JWT # pip install djang ...

  2. vagrant的学习 之 ThinkPHP5.1

    vagrant的学习 之 ThinkPHP5.1 本文根据慕课网的视频教程练习,感谢慕课网! 慕课视频学习地址:https://www.imooc.com/video/14218. 慕课的参考文档地址 ...

  3. World is Exploding 树状数组+离散化

    Given a sequence A with length n,count how many quadruple (a,b,c,d) satisfies: a≠b≠c≠d,1≤a<b≤n,1≤ ...

  4. poj——1469 COURSES

    COURSES Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 24192   Accepted: 9426 Descript ...

  5. 07-js数组

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  6. Java的文件注释

    以下内容引用自http://wiki.jikexueyuan.com/project/java/documentation.html: Java语言支持三种注释形式: 注释 描述 /*text*/ 编 ...

  7. 将mysql数据库数据导出为.sql文件

    打开Navicat ,在我们要到处的数据上面右击鼠标,然后弹出的快捷菜单上点击“转储SQL 文件”,在再次弹出的子菜单项中选择第一个“数据跟结构”.

  8. vue 重要的东西

  9. 关于android中的单位(dp、sp)

    android让人头疼的适配问题. --------- Android 中的单位大概有这些: 经常使用的dip.sp.有时候用到px. --------- 介绍两个类: TypedValue:有一些单 ...

  10. 1064 - You have an error in your SQL syntax问题解决

    新建表sql语句例如以下,在navicat for mysql 中执行,报错. CREATE TABLE `t_article`( `bh` bigint(20) NOT NULL PRIMARY K ...