ural 1084 Goat in the Garden
2014-03-17 15:22
435 查看
#include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; const double pi=acos(-1.0); int main() { double a,r; scanf("%lf%lf",&a,&r); if(a>=r*2) printf("%.3lf\n",pi*r*r);//绳子形成的圆在正方形内 else if(r>=sqrt(2)*a/2) printf("%.3lf\n",a*a);//正方形在圆内 else { double a1=a/2.0/r; double s1=sqrt(1-a1*a1); double ji=atan(s1/a1); double s=r*s1*a/2.0*4+(pi/2-ji*2)*r*r/2.0*4; printf("%.3lf\n",s); } return 0; }
View Code
相关文章推荐
- URAL 1084 || Goat in the Garden(同中心矩形与圆的公共面积
- ural 1084 Goat in the Garden
- ural 1348 Goat in the Garden 2
- URAL 1348 Goat in the Garden 2(点到线段的距离)
- Ural 1084|Goat in the Gardon|计算几何
- URAL 1348 Goat in the Garden 2(点到线段的距离)
- URAL 1348 Goat in the Garden 2计算几何(解题报告)
- 【点到线段距离】URAL - 1348 Goat in the Garden 2
- Goat in the Garden (ural 1348)
- URAL 1348 Goat in the Garden 2(点到线段的距离)
- URAL Goat in the Garden(圆与矩形求交集面积)
- Ural1084. Goat in the Garden
- sgu 1348 Goat in the Garden 2【点到线段的距离】
- sgu 1348 Goat in the Garden 2【点到线段的距离】
- ural 1348. Goat in the Garden 2
- URAL 1348. Goat in the Garden 2[求点到线段的距离]
- ural 1084. Goat in the Garden
- Goat in the Garden 2&&http://acm.timus.ru/problem.aspx?space=1&num=1348
- Ural-1084. Goat in the Garden(计算几何)
- Ural_1348. Goat in the Garden 2(计算几何)