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
 
Recommend
 
 
 
求多个三角形的面积和,
三角形面积 = absinC/2,C为a和b的夹角
 
 #include<bits/stdc++.h>
using namespace std; #define PI 3.1415926 int main()
{
//printf("%f\n", sin(90/180.0 * PI));
int n,len,ang;
while(~scanf("%d%d",&n,&len))
{
double sum=;
for(int i=;i<n;i++){
scanf("%d",&ang);
sum+=len*len*sin(ang/180.0 * PI)*0.5;
}
printf("%.3f\n",sum);
}
return ;
}
 
 

hdu 5979 Convex(水,求面积)的更多相关文章

  1. 覆盖的面积 HDU - 1255(扫描线求面积交)

    题意: 就是扫描线求面积交 解析: 参考求面积并.... 就是把down的判断条件改了一下..由w > 0 改为 w > 1 同时要讨论一下 == 1 时  的情况, 所以就要用到一个临时 ...

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

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

  3. HDU 1255 覆盖的面积(线段树:扫描线求面积并)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1255 题目大意:给你若干个矩形,让你求这些矩形重叠两次及以上的部分的面积. 解题思路:模板题,跟HDU ...

  4. HDU - 1255 覆盖的面积 (线段树求面积交)

    https://cn.vjudge.net/problem/HDU-1255 题意 给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区域的面积. 分析 求面积并的题:https://www.cnbl ...

  5. hdu 1542 线段树扫描(面积)

    Atlantis Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Su ...

  6. Herding(hdu4709)三点运用行列式求面积

    Herding Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...

  7. HDU 1542 Atlantis(矩形面积并)

    HDU 1542 Atlantis 题目链接 题意:给定一些矩形,求面积并 思路:利用扫描线,因为这题矩形个数不多,直接暴力扫就能够了.假设数据大.就要用线段树 代码: #include <cs ...

  8. hdu 1866 几个矩形面积的和 ***

    给出几个矩形,求出面积之和,相交区域只能算一次 一开始想用线段树求个并,后来发现没办法知道并了几次,然后就不会了 看了题解 本题其实很简单,但是想要想到转化也很不容易,因为本题是求面积之和,但是两个矩 ...

  9. poj 3348--Cows(凸包求面积)

    链接:http://poj.org/problem?id=3348 Cows Time Limit: 2000MS   Memory Limit: 65536K Total Submissions:  ...

随机推荐

  1. (4.7)sql server2008 中的merge

    简介 Merge关键字是一个神奇的DML关键字.它在SQL Server 2008被引入,它能将Insert,Update,Delete简单的并为一句.MSDN对于Merge的解释非常的短小精悍:”根 ...

  2. 003-spring结合java类调用quartz

    一.利弊 针对001 中设置,不方便程序中动态添加任务,只能使用配置进行配置任务, 适用于已知固定时刻需要执行的任务. 针对002中设置,不方便结合调用spring注入的实体 使用于程序内部新增添的任 ...

  3. Linux学习笔记—文件与文件系统的压缩与打包(转载)

    压缩文件的用途与技术 例如,计算机都是以byte单位来计量的,1byte占8bit.如果存储数字1,那么1byte就会空出7bit.采用一定的计算方式,压缩这些空间可以大大降低文件存储. Linux系 ...

  4. python库numpy的reshape的终极解释

    a = np.arange(2*4*4) b = a.reshape(1,4,4,2)           #应该这样按反序来理解:最后一个2是一个只有2个元素的向量,最后的4,2代表4×2的矩阵,最 ...

  5. CKEditor的下载、配置与使用

    CKEditor简介: CKEditor 是一款功能强大的开源在线文本编辑器.它所见即所得的特点,使你在编辑时所看到的内容和格式,能够与发布后看到的效果完全一致.CKEditor 完全是基于 Java ...

  6. Python中 and,or 的计算规则

    一.纯 and 和 or 语句 1. 在纯and语句中,如果每一个表达式都不是假的话,那么返回最后一个,因为需要一直匹配直到最后一个.如果有一个是假,那么返回假2. 在纯or语句中,只要有一个表达式不 ...

  7. day9 文件的读取

    文件操作 一.打开文件 f = open('歌词.txt','w',encoding='utf-8') # f:文件操作符 文件句柄 文件操作对象 open打开文件是依赖了操作系统提供的途径 操作系统 ...

  8. SharePoint 2010 以Jquery Ajax方式更新SharePoint列表数据!

    之前本人的博客介绍了<sharepoint 2010自定义访问日志列表设置移动终端否和客户端访问系统等计算列的公式>,那如何通过Jquery提交访问日志到自定义的SharePoint的访问 ...

  9. window下rails4.1 发生TZInfo::DataSourceNotFound 错误

    在官网上学习rails 4.1 ,启动rails server之后发生了如下错误 $ rails serverBooting WEBrickRails 4.1.0 application starti ...

  10. 【c++习题】【17/4/13】stack

    1.stack 模板.动态内存分配.析构 #include "stack2.cpp" #include <iostream> using namespace std; ...