题意:给出两点,求经过这两点的正n边形的最小面积 题解:这两点一定是最长的弦,我们设正多边形中点c,找到c到每个点的距离(都相同) 我们知道那个等腰三角形的底与每个角度就使用余弦定理 #include<set> #include<map> #include<queue> #include<stack> #include<cmath> #include<vector> #include<string> #include<…
题意:给定两个点A和B,求包含这两个点的面积最小的正 n(已知)边形. #include<iostream> #include<iomanip> #include<cmath> #define pi 2.0*asin(1.0) #define sqr(a) ((a)*(a)) using namespace std; int main() { int n; double x1,x2,y1,y2,d,thy,s; while(cin>>x1>>y1…
/** 题目:hdu6055 Regular polygon 链接:http://acm.hdu.edu.cn/showproblem.php?pid=6055 题意:给定n个坐标(x,y).x,y都是整数,求有多少个正多边形.因为点都是整数点,所以只可能是正四边形. 思路: (x1,y2)(x2,y2)=>(x,y) = (x2-x1,y2-y1) 向量(x,y)逆时针旋转90度:(-y,x):那么可以得到垂直(x,y)的向量,并通过(x2,y2)获得以(x2,y2)为起点的向量终点(x2+(…
Problem Description On a two-dimensional plane, give you n integer points. Your task is to figure out how many different regular polygon these points can make.   Input The input file consists of several test cases. Each case the first line is a numbe…
题目链接 **Problem Description On a two-dimensional plane, give you n integer points. Your task is to figure out how many different regular polygon these points can make. Input The input file consists of several test cases. Each case the first line is a…
Regular polygon Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2004    Accepted Submission(s): 795 Problem Description On a two-dimensional plane, give you n integer points. Your task is to fig…
/* HDU 6055 - Regular polygon [ 分析,枚举 ] 题意: 给出 x,y 都在 [-100, +100] 范围内的 N 个整点,问组成的正多边形的数目是多少 N <= 500 分析: 分析可知,整点组成的正多边形只能是正方形 故枚举两个点,验证剩下两个点的位置 坑点: 由于点的范围是 [-100, +100],故经过计算得出的点的范围可能是 [-300,+300],注意越界 编码时长:46分钟(-1) */ #include <bits/stdc++.h> u…
Regular polygon Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2219    Accepted Submission(s): 880 Problem Description On a two-dimensional plane, give you n integer points. Your task is to fig…
Description On a two-dimensional plane, give you n integer points. Your task is to figure out how many different regular polygon these points can make.   Input The input file consists of several test cases. Each case the first line is a numbers N (N…
Regular polygon Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1529    Accepted Submission(s): 597 Problem Description On a two-dimensional plane, give you n integer points. Your task is to fig…