不妨设$r1\le r2\le r3$,令$f(\alpha)=E(S_{\Delta}ABC)$,其中AB坐标分别为$(r_{1},0)$和$(r_{2}\cos \alpha,r_{2}\sin \alpha)$,C在原点为圆心、$r_{3}$为半径的圆上,那么有答案$ans=\lim_{n\to\infty}\limits\frac{\sum_{i=1}^{n}f(\frac{2\pi i}{n})}{n}$,而由于答案误差可以较大,因此n取1000左右即可
考虑求$f(\alpha)$,可以求出$l=|AB|=\sqrt{(r_{2}\cos\alpha-r_{1})^{2}+(r_{2}\sin \alpha)^{2}}$,作$CH\perp AB$交AB于点H,那么有$f(\alpha)=\frac{l\cdot E(CH)}{2}$
考虑求$E(CH)$,延长AB交最大的圆于点D,作$OE\verb|//|AB$交最大的圆于点E交CH延长线于点H',那么根据这些可以求出$\beta=\angle DOE=\angle ADO=\arcsin \frac{r_{1}r_{2}\sin\alpha}{r_{3}l}$,$h=HH'=r_{3}\sin\beta$,然后对$\gamma=\angle COA-\angle DOA$分类讨论:
1.$\beta\le \gamma< \pi+\beta$,那么$E(CH)=\begin{equation*}\int_{0}^{\pi} h+r_{3}\sin(\gamma-\beta)\  \rm d(\gamma-\beta)\end{equation*}=\pi h+2r_{3}$
2.$\pi+2\beta \le \gamma<2\pi$,那么$E(CH)=\begin{equation*}\int_{\beta}^{\pi-\beta} (r_{3}\sin (\gamma-\beta-\pi)-h)\  \rm d(\gamma-\beta-\pi)\end{equation*}=2r_{3}\cos\beta-(\pi-2\beta)h$
3.$0\le \gamma<\beta$或$\pi+\beta\le \gamma<\pi+2\beta$,那么$E(CH)=2\begin{equation*}\int_{0}^{\beta} (h-r_{3}\sin (\beta-\gamma))\  \rm d(\beta-\gamma)\end{equation*}=2\beta h+2r_{3}(\cos\beta-1)$
综上,$E(CH)=\frac{(\pi h+2r_{3})+(2r_{3}\cos\beta-(\pi-2\beta )h)+(2\beta h+2r_{3}(\cos\beta-1))}{2\pi}=\frac{2\beta h+2r_{3}cos\beta}{\pi}$,代入即可得到$f(\alpha)=\frac{l(\beta h+r_{3}\cos\beta)}{\pi}$

 1 #include<bits/stdc++.h>
2 using namespace std;
3 #define pi acos(-1.0)
4 int t,r1,r2,r3;
5 double sqr(double a){
6 return a*a;
7 }
8 double f(double a){
9 double l=sqrt(sqr(r2*cos(a)-r1)+sqr(r2*sin(a)));
10 double h=r1*r2*sin(a)/l;
11 double b=asin(h/r3);
12 return l*(b*h+cos(b)*r3)/pi;
13 }
14 int main(){
15 scanf("%d",&t);
16 while (t--){
17 scanf("%d%d%d",&r1,&r2,&r3);
18 if (r1>r2)swap(r1,r2);
19 if (r1>r3)swap(r1,r3);
20 if (r2>r3)swap(r2,r3);
21 double ans=0;
22 for(int i=1;i<=1000;i++)ans+=f(2*i*pi/1000.0)/1000.0;
23 printf("%.1f\n",ans);
24 }
25 }

[nowcoder5667K]Keyboard Free的更多相关文章

  1. Fedora 22中的Locale and Keyboard Configuration

    Introduction The system locale specifies the language settings of system services and user interface ...

  2. android:configChanges="keyboard|keyboardHidden|orientation|screenSize"

    <activity android:name="xxxActivity" android:configChanges="keyboard|keyboardHidde ...

  3. USB Keyboard Recorder

    catalogue . 引言 . Device Class Definition for Human Interface Devices (HID) . USB HID Report Descript ...

  4. imx6 matrix keyboard

    imx6需要添加4x4的矩阵键盘.本文记录添加方法. 参考链接 http://processors.wiki.ti.com/index.php/TI-Android-JB-PortingGuide h ...

  5. Codeforces Round #389 Div.2 B. Santa Claus and Keyboard Check

    time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...

  6. UVa 11998 Broken Keyboard (数组模拟链表问题)

    题目链接: 传送门 Broken Keyboard #include<bits/stdc++.h> using namespace std; char str[100010]; int m ...

  7. vimium Keyboard Bindings

    Modifier keys are specified as `<c-x>`, `<m-x>`, and `<a-x>` for ctrl+x, meta+x, a ...

  8. UVa 11988 Broken Keyboard(链表->数组实现)

    /*数组形式描述链表:链表不一定要用指针. 题目链接:UVa 11988 Broken Keyboard 题目大意: 小明没有开屏幕输入一个字符串,电脑键盘出现了问题会不定时的录入 home end ...

  9. 6754 Keyboard of a Mobile Telephone

    /*实践再次说明ch=getchar()的速度非常慢*/ /*大水题,不解释*/ #include<stdio.h> #include<string.h> int main() ...

随机推荐

  1. nvidia jetson xavier 风扇开机自启动

    作者声明 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 原文链接:https://www.cnblogs.com/phoenixash/p/15 ...

  2. 视频需求超平常数 10 倍,却节省了 60% 的 IT 成本投入是一种什么样的体验?

    作者 | 山猎 近年来,Serverless 一直在高速发展,并呈现出越来越大的影响力.主流的云服务商也在不断地丰富云产品体系,提供更好的开发工具,更高效的应用交付流水线,更好的可观测性,更细腻的产品 ...

  3. LeetCode352 将数据流变为多个不相交区间

    LeetCode352 将数据流变为多个不相交区间 1 题目 给你一个由非负整数 a1, a2, ..., an 组成的数据流输入,请你将到目前为止看到的数字总结为不相交的区间列表. 实现 Summa ...

  4. FastAPI 学习之路(十四)响应模型

    系列文章: FastAPI 学习之路(一)fastapi--高性能web开发框架 FastAPI 学习之路(二) FastAPI 学习之路(三) FastAPI 学习之路(四) FastAPI 学习之 ...

  5. Spark解决SQL和RDDjoin结果不一致问题(工作实录)

    问题描述:DataFrame的join结果不正确,dataframeA(6000无重复条数据) join dataframeB(220条无重复数据,由dataframeA转化而来,key值均源于dat ...

  6. 《看漫画学Pyhton》中计算水仙花数

    利用while循环实现 i = 100 r = 0 s = 0 t = 0 while i < 1000: r = i // 100 s = (i - r * 100) // 10 t = i ...

  7. Less-(5~7) error based

    Less-5: 核心语句: 我们注意到,当输入正确时,并不能获得有价值的回显.好在出现错误时,会爆出错误内容: 于是,使用报错注入: 1'  and updatexml(1,concat(0x7e,( ...

  8. Java中的函数式编程(六)流Stream基础

    写在前面 如果说函数式接口和lambda表达式是Java中函数式编程的基石,那么stream就是在基石上的最富丽堂皇的大厦. 只有熟悉了stream,你才能说熟悉了Java 的函数式编程. 本文主要介 ...

  9. 写了10000条Airtest截图脚本总结出来的截图经验,赶紧收藏!

    前言 今天想先给大家分享1个小白用户的Airtest从入门到放弃的故事: 小A是一个自动化的小白,在逛测试论坛的时候,偶然间发现了Airtest这个基于图像识别的UI自动化框架. 出于好奇,小A试用了 ...

  10. Java:并发笔记-01

    Java:并发笔记-01 说明:这是看了 bilibili 上 黑马程序员 的课程 java并发编程 后做的笔记 1. 进程与线程 本章内容 进程和线程的概念 并行和并发的概念 线程基本应用 1.1 ...