Convex

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

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

题意:

给n个点,每个点距顶点的距离都是d,给出每两点与顶点连线之间的角度,求所形成的凸包的上表面积。

三角形S==0.5*a*b*sinc

注意 ,sin操作的是弧度而非角度,故要转换成弧度:

弧度==角度*PI/180   (PI=acos(-1.0))。

AC代码:

 #include<bits/stdc++.h>
using namespace std; #define PI acos(-1.0) int main(){
ios::sync_with_stdio(false);
int n,d,x;
double sum=;
while(cin>>n>>d){
sum=;
for(int i=;i<n;i++){
cin>>x;
sum+=0.5*d*d*sin(x*1.0*PI/);
}
printf("%.3lf\n",sum);
}
return ;
}

HDU-5979的更多相关文章

  1. HDU 5979 Convex【计算几何】 (2016ACM/ICPC亚洲区大连站)

    Convex Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Subm ...

  2. hdu 5979 Convex(水,求面积)

    Convex Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Subm ...

  3. 2016ACM/ICPC亚洲区大连站现场赛题解报告(转)

    http://blog.csdn.net/queuelovestack/article/details/53055418 下午重现了一下大连赛区的比赛,感觉有点神奇,重现时居然改了现场赛的数据范围,原 ...

  4. HDU 5963 朋友 【博弈论】 (2016年中国大学生程序设计竞赛(合肥))

    朋友 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Problem Descr ...

  5. HDU 5969 最大的位或 【贪心】 (2016年中国大学生程序设计竞赛(合肥))

    最大的位或 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Problem De ...

  6. HDU 5968 异或密码 【模拟】 2016年中国大学生程序设计竞赛(合肥)

    异或密码 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Problem Des ...

  7. HDU 5961 传递 【图论+拓扑】 (2016年中国大学生程序设计竞赛(合肥))

    传递 Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)     Problem ...

  8. HDU 5965 扫雷 【模拟】 (2016年中国大学生程序设计竞赛(合肥))

    扫雷 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submissi ...

  9. hdu 5971 Wrestling Match 判断能否构成二分图

    http://acm.hdu.edu.cn/showproblem.php?pid=5971 Wrestling Match Time Limit: 2000/1000 MS (Java/Others ...

  10. HDOJ 2111. Saving HDU 贪心 结构体排序

    Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

随机推荐

  1. Java线程:概念及原理

    线程是执行的程序中的一个线程. Java虚拟机允许应用程序必须同时运行多个执行线程. 每个线程都有一个优先事项.具有更高优先级的线程优先于线程的优先级较低的执行.每个线程可能会或可能不会也被标记为一个 ...

  2. 一步一步学ios UITextView(多行文本框)控件的用法详解(五5.8)

    本文转载至 http://wuchaorang.2008.blog.163.com/blog/static/48891852201232014813990/     1.创建并初始化 创建UIText ...

  3. python 基础 8.0 regex 正则表达式--常用的正则表达式

    一. python 中常用的正则表达式         二. 正则表达式的网站,可以进行在线正则匹配 https://regex101.com/   1. 使用方法及正则介绍 1> ‘.’  匹 ...

  4. 【BZOJ4197】[Noi2015]寿司晚宴 状压DP+分解质因数

    [BZOJ4197][Noi2015]寿司晚宴 Description 为了庆祝 NOI 的成功开幕,主办方为大家准备了一场寿司晚宴.小 G 和小 W 作为参加 NOI 的选手,也被邀请参加了寿司晚宴 ...

  5. EasyPlayer RTSP播放器对RTSP播放地址url的通用兼容修改意见

    问题反馈 最近在线上遇到一位老朋友咨询关于EasyPlayer播放器的事情,大概现象就是分别用EasyPlayer和vlc播放大华摄像机的RTSP流,流地址是:rtsp://admin:admin12 ...

  6. SpringMVC @ResponseBody和@RequestBody使用

    @ResponseBody用法 作用: 该注解用于将Controller的方法返回的对象,根据HTTP Request Header的Accept的内容,通过适当的HttpMessageConvert ...

  7. Software-defined networking

    Software-defined networking administrators to programmatically initialize, control, change, and mana ...

  8. Ubuntu PPPoE拨号上网指定网卡

    Just follow these steps: Check that the ethernet cable is properly connected Open Terminal Run sudo ...

  9. python之virtualenv 与 virtualenvwrapper 详解

    在使用 Python 开发的过程中,工程一多,难免会碰到不同的工程依赖不同版本的库的问题: 亦或者是在开发过程中不想让物理环境里充斥各种各样的库,引发未来的依赖灾难. 此时,我们需要对于不同的工程使用 ...

  10. java.lang.UnsupportedClassVersionError: com/dw/Function : Unsupported major.minor version 52.0

    本地环境中有jdk7和jdk8,当把jdk8改为jdk7时,出现如下错误,是jdk版本的问题,在Properties-->JAVA Compiler-中的Compiler compliance ...