http://codeforces.com/problemset/problem/507/B
水题
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
double r,x,y,xx,yy;
while(cin>>r>>x>>y>>xx>>yy)
{
double res=sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
res/=r*2;
int ans=(int)res;
if(ans!=res)
ans++;
cout<<ans<<endl;
}
return 0;
}
本文介绍了一个简单的 CodeForces 507/B 的圆圈覆盖问题及其解决方法。该问题要求计算至少需要多少个半径为 r 的圆来完全覆盖另一个圆的边界。通过计算两个圆心之间的距离并除以2倍的半径来得出答案。
480

被折叠的 条评论
为什么被折叠?



