2016ICPC-大连 Convex (几何)

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
InputThere 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.
OutputFor 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

S=1/2*a*b*sinA把各个小三角形的面积加起来就好水题
 1 #include <iostream>
 2 #include<cstdio>
 3 #include<algorithm>
 4 #include<cstring>
 5 #include<string>
 6 #include<queue>
 7 #include<vector>
 8 #include<cmath>
 9 using namespace std;
10 const double pi=acos(-1.0);
11 int n,d,x;
12 int main()
13 {
14      while(~scanf("%d%d",&n,&d))
15     {
16         double sum=0;
17        for(int i=1;i<=n;i++)
18        {
19            scanf("%d",&x);
20            sum+=0.5*d*d*sin(x*1.0*pi/180.0);
21        }
22        printf("%.3lf\n",sum);
23     }
24     return 0;
25 }
时间: 2024-11-08 22:58:42

2016ICPC-大连 Convex (几何)的相关文章

hdu 5869 Different GCD Subarray Query BIT+GCD 2016ICPC 大连网络赛

Different GCD Subarray Query Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 828    Accepted Submission(s): 300 Problem Description This is a simple problem. The teacher gives Bob a list of prob

2016ICPC 大连

A.1:41:18 solved by hl 大致就是一个图上染色判断是否有矛盾. 按照样例来看,似乎存在孤立点就要输出NO #include <map> #include <set> #include <ctime> #include <cmath> #include <queue> #include <stack> #include <vector> #include <string> #include &

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 y

数学5. 一道几何题

大连北纬39°,北回归线纬度为23.5°. 在夏至时,太阳直射北回归线. 请问:此时在大连太阳落山时是西偏南,还是西偏北?多少度? 数学5. 一道几何题,布布扣,bubuko.com

hdu 1115 Lifting the Stone (数学几何)

Lifting the Stone Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5203    Accepted Submission(s): 2155 Problem Description There are many secret openings in the floor which are covered by a big

大连烤瓷牙的寿命

大连烤瓷牙的寿命  烤瓷牙从诞生至今已有50多年的历史了,伴随了我们成长的步伐,为许多牙齿缺失患者解决了烦恼.烤瓷牙的寿命也成为了很多亟需牙齿修复患者所关心的话题,那么大连烤瓷牙的寿命是多久呢? [烤瓷牙的寿命几何] 康贝佳专家表示:制作精良的烤瓷牙配合后期的维护保养能维持二十年甚至更长,烤瓷牙的寿命受以下几方面因素影响. 一.烤瓷牙的材料:瓷与金属的相容性不同,不同材料的烤瓷牙所承受的咬合力也是不同的,因此,烤瓷牙材料不同,使用寿命也会有一定的差别. 二.自身牙齿情况:烤瓷牙的寿命和患者牙齿的

cdoj 93 King&#39;s Sanctuary 傻逼几何题

King's Sanctuary Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/problem/show/93 Description The king found his adherents were building four sanctuaries for him. He is interested about the positions of the sanctuaries and want

ACdream1012:Convex

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 neig

URAL - 1963(几何)

不知道是不是几何题,反正就是找对称,值得注意的是,对称轴不一定过点,还可能在边上 #include <iostream> #include <cstring> #include <cstdio> #include <algorithm> #include <cmath> using namespace std; const double mm=1e-7; double x[10],y[10]; bool deng(double a,double