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. 转载 -- iOS开发之JSON格式数据的生成与解析

    本文将从四个方面对IOS开发中JSON格式数据的生成与解析进行讲解: 一.JSON是什么? 二.我们为什么要用JSON格式的数据? 三.如何生成JSON格式的数据? 四.如何解析JSON格式的数据? ...

  2. win本地配置docker环境

    先上官网链接:https://docs.docker.com/get-started/part2/#introduction 优质入门教程:http://www.docker.org.cn/book/ ...

  3. 申请edu邮箱

    https://blog.csdn.net/w305607610/article/details/86771593 手把手教你申请CCC(City Colleges of Chicago)教育邮箱 台 ...

  4. 用nvm管理windows nodejs时用npm全局安装的插件无法调用的解决方案

    在环境变量中啊新建变量NODE_PATH赋值为prefix设置的地址即 prefix=D:\Users\xxx\AppData\Roaming\nodejs\npm-global 然后把%NODE_P ...

  5. special points about git

    1 about "origin/master tracks the remote branch" 1.1 what does tracking mean? after " ...

  6. 点聚-weboffice 6.0 (一)

    WebOffice是一款由北京点聚信息技术有限公司提供的完全免费(商业用途也免费)且功能强大的在线Word/excel/wps编辑辅助控件,可以实现:1.在线编辑Word.Excel.PPT.WPS. ...

  7. Android Studio第一次启动失败的解决办法

    Android Studio Android 开发环境 由于GFW的问题,安装后第一次启动会在显示Fetching android sdk component information对话框后,提示错误 ...

  8. 算法(Algorithms)第4版 练习 1.3.10

    主要思路:和1.3.9相似,只不过运算表达式的生成方式不一样 用Dijkstra的双栈算法. 遇到数字则压入数字栈中(String). 遇到运算符则压入运算符栈中(String). 遇到右括号时,从数 ...

  9. Contiki Etimer 模块

    一.Etimer概述 Etimer提供产生时间事件(timed event)的机制,当设定好的timer到期时,将会给设定etimer的process发送一个PROCESS_EVENT_TIMER 事 ...

  10. matlab之boundary()函数

    j = boundary(x,y,0.1); %这个函数是求一堆(平面)点的边界,它不是凸包,这里的边界可以凹陷,第三个参数0.1代表以松散的形式画出边界,1是以最紧凑的形式画出边界. 下面这个是官网 ...