题目链接:点击查看

题意:现在给出一个大圆圈,然后在大圆圈里面要放多个小圆圈,且要求所有的小圆圈必须与大圆圈的内表面相切,两个小圆圈之间的距离要大于等于给定值s。

题解:取两个相邻的小圆,圆心连接,取弦的中点做直角三角形,这个夹角就是一个小圆对应圆心角的一半

HDU - 1943 Ball bearings 计算几何

#include <bits/stdc++.h>
using namespace std;
#define PI acos(-1)
#define eps 1e-8
int main()
{
	int T;
	double D,d,s;
	scanf("%d",&T);

	while(T--)
	{
		scanf("%lf%lf%lf",&D,&d,&s);
		double J=asin((d+s)/(D-d));
		double ans=PI/J;
		printf("%d\n",(int)(ans+eps));
	}
	return 0;	
} 

 

相关文章:

  • 2022-12-23
  • 2021-09-05
  • 2022-01-10
  • 2022-12-23
  • 2021-08-15
  • 2022-01-05
  • 2021-07-19
  • 2022-12-23
猜你喜欢
  • 2021-12-21
  • 2022-12-23
  • 2021-05-23
  • 2021-12-21
  • 2021-05-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案