UVALive 6324 Archery (求射箭覆盖的期望)
2024-08-23 01:19:09
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
const double pi=3.141592653;
int main(){
int t;
scanf("%d",&t);
while(t--){
int n;
scanf("%d",&n); double ans=; double x1,y1,x2,y2; for(int i=;i<=n;i++){
scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);
double temp=fabs(atan2(y1,x1)-atan2(y2,x2));//atan2,特别注意
if(temp>pi)
temp=2.0*pi-temp;
ans+=temp; }
printf("%.5lf\n",ans/(pi*2.0)); }
return ;
}
最新文章
- iOS Salesforce SDK 小知识
- GoLang 通过http Post获取数据
- Yaf零基础学习总结5-Yaf类的自动加载
- Bounce.js – 快速创建漂亮的 CSS3 动画效果
- Android——Handler总结
- CentOS 配置vncserver
- uestc 1721 吴神,人类的希望
- DEV GridControl 鼠标单击事件
- Hibernate持久化对象状态
- 回调函数 use
- JS-类型转换
- Python @property 详解
- phpcms V9首页、列表页以及内容页调用标签
- SQL Server最大内存设为0后的处置办法
- Codeforces Round #507 Div. 1
- day03 变量 运算符 基本数据类型 输出功能 格式化输出
- postgresql-磁盘空间不足问题排查
- 别人的Linux私房菜(1)计算机概论
- Supported Values for @SuppressWarnings(转)
- js判断操作系统与浏览器