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 ...
随机推荐
- GC与显式内存管理
C++复兴的话题至今已被鼓吹两年有余,Herb Sutter和Bjarne Stroustrup等大牛们也为C++带来了大步伐的革新.然而,从这两年的效果而言,C++的复兴并没有发生.一方面随着世界经 ...
- QE是什么
量化宽松(Quantitative Easing,简称QE),是一种货币政策,主要指各国央行通过公开市场购买政府债券.银行金融资产等做法.量化宽松直接导致市场的货币供应量增加,可视为变相“印钞”.市场 ...
- Java实现文件的预览
最近项目需要用到文件的预览功能,就开始在网上收集资料,学习了几种文件预览的方法.我集成到我项目内测试的有以下三种,最后使用的是第三种: 直接使用别人提供的服务 例如:office web 365 使用 ...
- 基于Struts2 的日志管理系统的Java实现
1.首先,项目的架构如下: 2.com.sxl.dba 中:OracleConnector.java package com.sxl.dba; import java.sql.*; ...
- Micosoft.ReportViewer.WebForms v 11.0... 1.0.1
his dll is required for the use of Microsoft's forms based ReportViewer control. This version is to ...
- POJ1595_Prime Cuts【素数】【水题】
Prime Cuts Time Limit: 1000MSMemory Limit: 10000K Total Submissions: 10464Accepted: 3994 Description ...
- [Redux] Reducer Composition with combineReducers()
Previous, we do composition with objects: const todoApp = (state = {}, action) => { return { todo ...
- A+B问题(java)
import java.util.Scanner; public class Main { public static void main ( String args[] ) { Scanner in ...
- 读书笔记--用Python写网络爬虫01--网络爬虫简介
Wiki - Web crawler 百度百科 - 网络爬虫 1.1 网络爬虫何时使用 用于快速自动地获取网络信息,避免重复性的手工操作. 1.2 网络爬虫是否合法 网络爬虫目前人处于早期的蛮荒阶段, ...
- memcache和activemq使用连接,然后close
memcache和activemq使用连接,然后close