ural 1084 Goat in the Garden
#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*) printf("%.3lf\n",pi*r*r);//绳子形成的圆在正方形内
else if(r>=sqrt()*a/) printf("%.3lf\n",a*a);//正方形在圆内
else
{
double a1=a/2.0/r;
double s1=sqrt(-a1*a1);
double ji=atan(s1/a1);
double s=r*s1*a/2.0*+(pi/-ji*)*r*r/2.0*;
printf("%.3lf\n",s);
}
return ;
}
ural 1084 Goat in the Garden的更多相关文章
- ural 1348 Goat in the Garden 2
		
http://acm.timus.ru/problem.aspx?space=1&num=1348 #include <cstdio> #include <cstring&g ...
 - sgu 1348 Goat in the Garden 2【点到线段的距离】
		
链接: http://acm.timus.ru/problem.aspx?space=1&num=1348 http://acm.hust.edu.cn/vjudge/contest/view ...
 - URAL题解二
		
URAL题解二 URAL 1082 题目描述:输出程序的输入数据,使得程序输出"Beutiful Vasilisa" solution 一开始只看程序的核心部分,发现是求快排的比较 ...
 - OJ题解记录计划
		
容错声明: ①题目选自https://acm.ecnu.edu.cn/,不再检查题目删改情况 ②所有代码仅代表个人AC提交,不保证解法无误 E0001 A+B Problem First AC: 2 ...
 - 训练报告 (2014-2015) 2014, Samara SAU ACM ICPC Quarterfinal Qualification Contest
		
Solved A Gym 100488A Yet Another Goat in the Garden B Gym 100488B Impossible to Guess Solved C Gym ...
 - POJ 1518 A Round Peg in a Ground Hole【计算几何=_=你值得一虐】
		
链接: http://poj.org/problem?id=1584 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22013#probl ...
 - POJ 1584 A Round Peg in a Ground Hole【计算几何=_=你值得一虐】
		
链接: http://poj.org/problem?id=1584 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22013#probl ...
 - ural 2064. Caterpillars
		
2064. Caterpillars Time limit: 3.0 secondMemory limit: 64 MB Young gardener didn’t visit his garden ...
 - HDU5977 Garden of Eden(树的点分治)
		
题目 Source http://acm.hdu.edu.cn/showproblem.php?pid=5977 Description When God made the first man, he ...
 
随机推荐
- [TCO 2012 Round 3A Level3] CowsMooing (数论,中国剩余定理,同余方程)
			
题目:http://community.topcoder.com/stat?c=problem_statement&pm=12083 这道题还是挺耐想的(至少对我来说是这样).开始时我只会60 ...
 - SVN linux端配置
			
1.create a folder: mkdir /sandbox/svn 2.create svn repository: svnadmin create /sandbox/svn/ ...
 - 基于Equinox构建OSGi项目
			
几种OSGi框架 Several independently implemented OSGi frameworks exist today, including four that are avai ...
 - web service1简单的例子用jdk自带的类
			
1,建立自己的java项目my_service 2,建立包,com.hjg.service 3,创建类: IMyService.java package com.hjg.service; import ...
 - 史上最全maven pom.xml详解
			
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...
 - Photography theory: a beginner's guide(telegraph.co.uk)
			
By Diane Smyth, Tim Clark, Rachel Segal Hamilton and Lewis Bush 11:00AM BST 09 Jun 2014 Have you r ...
 - mysql数据库sql常用命令
			
1.查看索引:mysql> show index from tblname; 2.利用索引查询:SELECT * FROM product WHERE ID > =(select id f ...
 - android实现界面左右滑动(GridView动态设置item,支持每个item按某个属性排序来显示在不同的界面)
			
效果图 : 分别是第一页.第二页.第三页,随手截的图,不整齐,勿见怪.开始走了弯路,废了不少时间. 思路如下: 1.用ViewPager实现左右分页滑动 ...
 - Linux设备驱动中断机制
			
[主要内容] Linux设备驱动编程中的中断与定时器处理 [正文] 一.基础知识 1.中断 所谓中断是指CPU在执行程序的过程中,出现了某些突发事件急待处理,CPU必须暂停执行当前的程序,转去处理突发 ...
 - ListView 水平滑动 水平和竖直滑动
			
效果 Activity public class MainActivity extends Activity { @Override protected void onCreate(B ...