hdu 5979 Convex

Convex

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 670    Accepted Submission(s): 438

Problem Description

We have a special convex that all points have the same distance to origin point.
As you know we can get N segments after linking the origin point and the points on the convex. We can also get N angles between each pair of the neighbor segments.
Now give you the data about the angle, please calculate the area of the convex

Input

There are multiple test cases.
The first line contains two integer N and D indicating the number of the points and their distance to origin. (3 <= N <= 10, 1 <= D <= 10)
The next lines contain N integers indicating the angles. The sum of the N numbers is always 360.

Output

For each test case output one float numbers indicating the area of the convex. The printed values should have 3 digits after the decimal point.

Sample Input

4 1
90 90 90 90
6 1
60 60 60 60 60 60

Sample Output

2.000
2.598

Source

2016ACM/ICPC亚洲区大连站-重现赛(感谢大连海事大学)

Recommend

时间: 2024-09-30 16:37:07

hdu 5979 Convex的相关文章

hdu 3629 Convex(计数问题)

题目链接:hdu 3269 Convex 题目大意:给出n个点,问任选四个点可以组成多少个凸四边形. 解题思路:和uav11529的做法是一样的,只不过求的东西不一样. #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #include <iostream> using namespace std; typedef long long ll; co

hdu 3629 Convex

题意:给你N个点,让你选四个点组成凸多边形,求总的方法数 详细解释:http://blog.sina.com.cn/s/blog_64675f540100ksug.html 1 #include<iostream> 2 #include<vector> 3 #include<cstring> 4 #include<cstdio> 5 #include<cmath> 6 #include<stdlib.h> 7 #include<

【转】[专题学习][计算几何]

原文地址:http://www.cnblogs.com/ch3656468/archive/2011/03/02/1969303.html 基本的叉积.点积和凸包等东西就不多说什么了,网上一搜一大堆,切一些题目基本熟悉了就差不多了. 一些基本的题目可以自己搜索,比如这个blog:http://blog.sina.com.cn/s/blog_49c5866c0100f3om.html 接下来,研究了半平面交,思想方法看07年朱泽园的国家队论文,模板代码参考自我校大牛韬哥: http://www.o

UVA 11529 - Strange Tax Calculation(计数问题)

题目链接:11529 - Strange Tax Calculation 题意:平面上n个建筑物,3个建筑物可以组成一个三角形,计算平均每个三角形内有多少个点 思路:问题等价于,求凹四边形的占所有四边形的比例,用O(n^2)的算法,跟 HDU 3629 Convex 这题是一个道理 代码: #include <stdio.h> #include <string.h> #include <math.h> #include <algorithm> using n

Hdu 3662 3D Convex Hull(三维凸包)

题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=3662 思路:三维凸包模板. #include<cstdio> #include<vector> #include<cstring> #include<iostream> #include<algorithm> #define PR 1e-8 #define N 510 using namespace std; struct TPoint { doub

hdu 6219 Empty Convex Polygons

- -先mark了 http://blog.csdn.net/nyroro/article/details/45268767 https://vjudge.net/solution/1919422 #include <stdio.h> #include <algorithm> #include <string.h> using namespace std; #define maxn 110 struct point{ int x,y; point(){} point(i

HDU 6617 Enveloping Convex(凸包+半平面交+二分)

首先对于这m个点维护出一个凸包M,那么问题就变成了判断凸包P进行放大缩小能不能包含凸包M.(凸包P可以进行中心对称变换再进行放大缩小,见题意) 如何判断合适的相似比呢,我们可以用二分去放大缩小凸包P的坐标,得到最小的相似比. 接下来就是如何判断是否包含.我们需要对凸包P上的每一条向量,在凸包M上找到这么一个点,使得这个点左侧的所有凸包M上的点都在向量的左侧,那么我们可以直接同时逆时针枚举,用一个变量维护凸包M上的点,因为是同逆时针,凸包M上的点至少有一个只会被遍历一次,那么复杂度可以证明为On,

HDU5979 Convex

1 /* 2 HDU5979 Convex 3 http://acm.hdu.edu.cn/showproblem.php?pid=5979 4 计算几何 三角形面积公式 5 * 6 * 7 */ 8 #include <cstdio> 9 #include <algorithm> 10 #include <cmath> 11 using namespace std; 12 const double Pi=acos(-1.0); 13 int main() 14 { 1

hdu 1348 Wall(凸包模板题)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1348 Wall Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3386    Accepted Submission(s): 968 Problem Description Once upon a time there was a gre