http://codeforces.com/problemset/gymProblem/100488/A
无法吐槽鬼畜题面。
题意:一个边长a,b,c的三角形里有一个半径为R的圆,圆可以在三角形里任意移动但不能出去,问无法被圆覆盖到的区域面积。
一开始想错了,想要什么用三角函数然后三角形面积减去圆面积乱搞然后被卡精度然后又被阳神训斥了。
其实有一个很简单的做法。我们考虑这个三角形的内接圆,内接圆半径可以用海伦公式直接弄出来
然后我们可以发现其实无法被覆盖到的部分都是相似的,然后相似比面积乱搞搞就可以了。
#include<cstdio> #include<cmath> using namespace std; const double pi=4*atan(1.0); double ans,a,b,c,r,s,R,p; int main(){ scanf("%lf%lf%lf%lf",&a,&b,&c,&r); p=(a+b+c)/2; s=sqrt(p*(p-a)*(p-b)*(p-c)); R=s/p; ans=r*r/R/R*s; ans-=r*r*pi; printf("%.15lf",1-ans/s); }
2022年9月11日 14:37
Every Telugu Medium, English Medium and Urdu Medium student of the State Board can download the AP 10th Class EVS Model Paper 2023 Pdf with answers for term-1 & term-2 exams of SA-1, SA-2 and other exams of the board. AP SSC Evs Model Paper Environmental Education is one of the most important subjects and it’s a part of Science. School Education Department and various leading private school teaching staff have designed and suggested the practice question paper for all Part-A, Part-B, Part-C, and Part-D questions of SA-1, SA-2, FA-1, FA-2, FA-3, FA-4 and Assignments. Advised to everyone can contact the class teacher to get important questions for all lessons and topics of EVS.