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 ...
随机推荐
- 国内三大PT(Private Tracker)站分析
除这一行外,下面全部内容都是转载.出处不明. 国内三大PT(Private Tracker)站分析 先郑重的声明一下:本文以下的内容所有是复制粘贴的,不代表老夫的观点. 事实上内容我也没细致看. 贴这 ...
- Ubuntu apt-get 错误 -11 -system error
错误图片 上述错误是dns解析错误,不能解析域名了,所以也访问不了 解决办法,添加dns,命令如下 sudo vim /etc/resolv.conf 添加 nameserver (此外填写域名服务器 ...
- linux中切换用户方式su和su -的区别
Using su The su command allows users to open a terminal window, and from that terminal start a sub ...
- spring04 spel注入
1.创建需要的实体类对象 public class Student { //学生实体类 private String name; //姓名 private Integer age; //年龄 priv ...
- python的运算符
#coding=utf-8#"+"两个对象相加#两个数字相加a=7+8print a #两个字符串相加b="GOOD"+"JOB"print ...
- SQL 语句修改列名 属性 默认值
--修改字段名exec sp_rename '表名.列名','新列名' --修改字段属性alter table 表名 alter column 列名 nvarchar(100) null; --修改默 ...
- static类
静态类,用于类内部. 静态类,不需要创建父类对象,即可使用. 非静态类,需要先创建父类对象,才可使用. class A{ static class B1{} class B2{} } = new A ...
- Eclipse+maven发布ee项目jar包未发布
背景:在Eclipse中搭建好EE环境后,发布时,出现ClassNotFoundException: XX.XX.ConfigureListener,查看时,对应的jar包都引入了,项目没也没出错,但 ...
- Win8节省C盘空间攻略
问题分析: 1.系统页面文件(虚拟内存)占用空间 2.自动更新的缓存文件 3.系统保护的备份文件(系统还原用的) 4.休眠文件 5.索引文件 6.桌面文件 解决办法: 1.机器是8G内存,完全不需要虚 ...
- 没有找到iertutil.dll怎么办?快速解决iertutil.dll丢失
iertutil.dll 是存放在 C:\Windows\System32 目录下的一个动态链接库文件,它提供函数给其他程序所调用.iertutil.dll 能够实现接到互联网,纪录输入,监控应用程序 ...