CodeForces 507B Amr and Pins(几何 水)

 

#include<cstdio>

#include<cmath>

#include<cstring>

#include<iostream>

#include<algorithm>

using namespace std;

int main()

{

    double r,x,y,x1,y1;

    while(scanf("%lf%lf%lf%lf%lf",&r,&x,&y,&x1,&y1)!=EOF)

    {

        double dis=sqrt((y1-y)*(y1-y)+(x1-x)*(x1-x));

        double ans=dis/(2*r);

        if(ans-(int)ans!=0) ans++;

        printf("%d\n",(int)ans);

    }

    return 0;

}
View Code

 

你可能感兴趣的:(codeforces)