题意:n个点在一个半径为R的圆上,给出这n个点顺时针的夹角差值,求这n个点的凸包面积

n<=10,R<=10

思路:S=1/2*sinθ*a*b

角度转弧度再用sin

C++有点小毛病,叫队友改了下

 #include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef vector<int> VI;
#define fi first
#define se second
#define MP make_pair
#define N 1100000
#define MOD 1000000007
#define eps 1e-8
#define pi acos(-1) int n;
double L; int read()
{
int v=,f=;
char c=getchar();
while(c<||<c) {if(c=='-') f=-; c=getchar();}
while(<=c&&c<=) v=(v<<)+v+v+c-,c=getchar();
return v*f;
} int main()
{
while(scanf("%d%lf",&n,&L)!=EOF)
{
double ans=;
for(int i = ; i <= n; ++i)
{
double x;
scanf("%lf",&x);
x/=*1.0;
x*=pi*1.0;
ans+=1.0/*L*L*sin(x);
}
printf("%.3lf\n",ans);
}
return ;
}

最新文章

  1. VisualStudio自动编码插件(Autocode——devprojects.net)
  2. Android之全局的dialog的显示
  3. Eclipse cpp 开发 include路径
  4. 存储过程往拼接的sql语句中传递日期值
  5. 关于SWT的线程问题
  6. 基于.NET平台的分层架构实战(六)——依赖注入机制及IoC的设计与实现[转]
  7. 使用SharePoint管理中心管理服务
  8. Android 开场动画
  9. Android中文API (109) —— SimpleCursorTreeAdapter
  10. [Swift]LeetCode895. 最大频率栈 | Maximum Frequency Stack
  11. ssh整合详解
  12. (转)Linux企业运维人员最常用150个命令汇总
  13. SSH原理与运用:远程登录
  14. ppoint的使用
  15. [LOJ 6031]「雅礼集训 2017 Day1」字符串
  16. python中的sort方法
  17. [源码] YoCelsius
  18. 图论&amp;动态规划:虚树
  19. Unity5.X 新版AssetBundle打包控制
  20. webpack构建多页面react项目(webpack+typescript+react)

热门文章

  1. 导致实例逐出的五大问题 (文档 ID 1526186.1)
  2. js 两个数组进行去重处理,返回去重后的数组
  3. python之数据类型补充
  4. metasploit-shellcode生成
  5. bootstrap历练实例:复选框或单选按钮作为输入框组的前缀或后缀
  6. shell脚本,通过传参求斐波那契数列如(0,1,1,2,3,5,8,13..........)
  7. java在线聊天项目 swt可视化窗口Design 好友列表窗口
  8. vue input 判断
  9. c++:printf和cout那个更好更快些
  10. Java8特性详解 lambda表达式 Stream【转】