思路:三角形的圆心角可以整除(2*pi)/n

 #include<cstdio>
#include<cstring>
#include<iostream>
#include<queue>
#include<stack>
#include<algorithm>
using namespace std;
#define clc(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
const int N=;
#define LL long long
const double eps = 1e-;
const double pi = acos(-);
// inline int r(){
// int x=0,f=1;char ch=getchar();
// while(ch>'9'||ch<'0'){if(ch=='-') f=-1;ch=getchar();}
// while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
// return x*f;
// }
struct Point{
double x,y;
Point(double a=,double b=):x(a),y(b){}
}; double angle(Point a,Point b,Point c){
b.x-=a.x,b.y-=a.y;
c.x-=a.x,c.y-=a.y;
return acos((b.x*c.x+b.y*c.y)/(hypot(b.x,b.y)*hypot(c.x,c.y)));
} bool dcmp(double f,int n){
return fabs(f * n - round(f * n)) < eps;
} int main(){
while(){
Point p[];
for(int i=;i<;i++)
if(scanf("%lf%lf",&p[i].x,&p[i].y)!=) return ;
double a=angle(p[],p[],p[])/pi;
double b=angle(p[],p[],p[])/pi;
for(int i=;i<=;i++){
if(dcmp(a,i)&&dcmp(b,i)){
printf("%d\n",i);
break;
}
}
}
return ;
}

HDU 4195 Regular Convex Polygon的更多相关文章

  1. HDU4195 Regular Convex Polygon (正多边形、外接圆)

    题意: 给你正n边形上的三个点,问n最少为多少 思路: 三个点在多边形上,所以三个点的外接圆就是这个正多边形的外接圆,余弦定理求出每个角的弧度值,即该角所对边的圆周角,该边对应的圆心角为圆心角的二倍. ...

  2. HDU 6055 - Regular polygon | 2017 Multi-University Training Contest 2

    /* HDU 6055 - Regular polygon [ 分析,枚举 ] 题意: 给出 x,y 都在 [-100, +100] 范围内的 N 个整点,问组成的正多边形的数目是多少 N <= ...

  3. [LeetCode] Convex Polygon 凸多边形

    Given a list of points that form a polygon when joined sequentially, find if this polygon is convex ...

  4. Leetcode: Convex Polygon

    Given a list of points that form a polygon when joined sequentially, find if this polygon is convex ...

  5. HOJ 13101 The Triangle Division of the Convex Polygon(数论求卡特兰数(模不为素数))

    The Triangle Division of the Convex Polygon 题意:求 n 凸多边形可以有多少种方法分解成不相交的三角形,最后值模 m. 思路:卡特兰数的例子,只是模 m 让 ...

  6. ACM训练联盟周赛 G. Teemo's convex polygon

    65536K   Teemo is very interested in convex polygon. There is a convex n-sides polygon, and Teemo co ...

  7. 【LeetCode】469. Convex Polygon 解题报告(C++)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 计算向量夹角 日期 题目地址:https://leet ...

  8. HDU 6055 Regular polygon

    Regular polygon Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)T ...

  9. 2017ACM暑期多校联合训练 - Team 2 1011 HDU 6055 Regular polygon (数学规律)

    题目链接 **Problem Description On a two-dimensional plane, give you n integer points. Your task is to fi ...

随机推荐

  1. Magento Api 记录

    magento api 首次接触 (-) /** * magento Api 身份验证 调用示例 * Example of simple product POST using Admin accoun ...

  2. 同样的一句SQL语句在pl/sql 代码块中count 没有数据,但是直接用SQl 执行却可以count 得到结果

    pl/sql 代码块: SELECT count(distinct t2.so_nbr) INTO v_count2 FROM KFGL_YW_STEP_qd t2 WHERE t2.partitio ...

  3. Python调试工具-Spyder

    OS:Windows 7 关键字:Python IDE, Spyder 1.安装工具pip:https://pip.pypa.io/en/latest/installing.html 下载 get-p ...

  4. opengl混合效果

    效果如下图:

  5. jquery实现替代iframe的功能

    使用iframe能很好的嵌入其他的网页或者网站,但是iframe每次加载都会浪费好多的时间,且会阻止其他元素的加载,搜索引擎也不能识别页面ifram框架中被调用的链接.文本.图片等等内容的. Html ...

  6. appcache checking update

    <!DOCTYPE html> <html manifest="a.appcache"> <head> <title></ti ...

  7. 搭建 Win CE6.0 设备开发环境

    1.操作系统最好基于Windows XP.Vista.Win7 或以上的版本对ActiveSync软件不支持  2.安装VS2008,以及SP1 (一定要装SP1) 3.安装ActiveSync 4. ...

  8. IE9、 Firefox、Safari, Chrome的CSS3圆角属性

    这篇文章主要是记录一下,微软最新发布的 IE9 浏览器CSS 圆角属性,现在CSS3已经 可以轻松实现跨浏览器的圆角效果,包括Firefox高版本,IE9,Safari,Chrome等高端 浏览器. ...

  9. bzoj 2406: 矩阵 上下界网络流判定

    2406: 矩阵 Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 138  Solved: 46[Submit][Status][Discuss] De ...

  10. 小米MIUI 360wifi掉线解决方案 落雨

    问: 360WIFI 小米WIFI 联网无网速的解决办法 方法1.退出电脑和手机上的360安全卫士(我抱着试试的态度退出了之后,我艹,速度立马有了!),估计是这些安全软件太强大,导致的. 方法2.我用 ...