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
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
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.
90 90 90 90
6 1
60 60 60 60 60 60
2.598
#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(水,求面积)的更多相关文章
- 覆盖的面积 HDU - 1255(扫描线求面积交)
题意: 就是扫描线求面积交 解析: 参考求面积并.... 就是把down的判断条件改了一下..由w > 0 改为 w > 1 同时要讨论一下 == 1 时 的情况, 所以就要用到一个临时 ...
- HDU 5979 Convex【计算几何】 (2016ACM/ICPC亚洲区大连站)
Convex Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Subm ...
- HDU 1255 覆盖的面积(线段树:扫描线求面积并)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1255 题目大意:给你若干个矩形,让你求这些矩形重叠两次及以上的部分的面积. 解题思路:模板题,跟HDU ...
- HDU - 1255 覆盖的面积 (线段树求面积交)
https://cn.vjudge.net/problem/HDU-1255 题意 给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区域的面积. 分析 求面积并的题:https://www.cnbl ...
- hdu 1542 线段树扫描(面积)
Atlantis Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Su ...
- Herding(hdu4709)三点运用行列式求面积
Herding Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
- HDU 1542 Atlantis(矩形面积并)
HDU 1542 Atlantis 题目链接 题意:给定一些矩形,求面积并 思路:利用扫描线,因为这题矩形个数不多,直接暴力扫就能够了.假设数据大.就要用线段树 代码: #include <cs ...
- hdu 1866 几个矩形面积的和 ***
给出几个矩形,求出面积之和,相交区域只能算一次 一开始想用线段树求个并,后来发现没办法知道并了几次,然后就不会了 看了题解 本题其实很简单,但是想要想到转化也很不容易,因为本题是求面积之和,但是两个矩 ...
- poj 3348--Cows(凸包求面积)
链接:http://poj.org/problem?id=3348 Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: ...
随机推荐
- Spring 框架的事务管理
1. Spring 框架的事务管理相关的类和API PlateformTransactionManager 接口: 平台事务管理器(真正管理事务的类); TransactionDefinition 接 ...
- 我的Android进阶之旅------>解决Android Studio全局搜索搜不到结果的问题
1.问题描述 今天使用Android Studio时,想通过使用快捷键Ctrl+Shift+F来进行全局搜索指定字符串,如下图所示:想搜索字符串"码农偷懒了", 打开string. ...
- pandas数据分析第二天
一:汇总和计算描述统计 pandas对象拥有一组常用的数据和统计方法,用于从Series中提取单个值(sum,mean)或者从DataFrame的行或者列中提取一个Series对应的Numpy数组方法 ...
- Matlab/Simulink仿真中如何将Scope转化为Figure?
1.只需要在运行仿真后,在命令窗口内输入: ,'ShowHiddenHandle','on'); set(gcf,'menubar','figure'); scope最上方会出现一个菜单栏,选择Too ...
- Python基础教程-条件判断和循环
Python条件判断 在Python中用if语句实现: age = 20 if age >= 18: print 'your age is :',age print 'adult' 根据Pyth ...
- error:No resource found that matches the given name 'Theme.AppCompat.Light'
一.stsckoverflow http://stackoverflow.com/questions/17870881/cant-find-theme-appcompat-light-for-new- ...
- [转]如何用C#动态编译、执行代码
在开始之前,先熟悉几个类及部分属性.方法:CSharpCodeProvider.ICodeCompiler.CompilerParameters.CompilerResults.Assembly. 一 ...
- Django 分页器 缓存 信号 序列化
阅读目录 分页器 缓存 信号 序列化 Django分页器 (paginator) 导入 from django.core.paginator import Paginator, EmptyPage, ...
- yii根据id查询一条数据
model层 public function selectone($ag_id=''){ return $this->findBySql("SELECT * FROM agency w ...
- display:inline与display:block——行内元素显示与块级元素显示
display:inline 的作用是设置对象做为行内元素显示,inline是内联对象的默认值(ps:内联对象就是不自动产生换行的元素,比如span) 而我们一般用的div是块级元素,默认displa ...