ural 1874 Football Goal
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
const double eps=1e-; double getarea(double a,double b,double c)
{
double p=(a+b+c)/2.0;
return (c*c/+sqrt(p*(p-a)*(p-b)*(p-c)));
} int main()
{
double x,y;
scanf("%lf%lf",&x,&y);
double l=x+y,r=sqrt(x*x+y*y),s1;
while(fabs(r-l)>eps)
{
double mid1=(r+l)/;
double mid2=(mid1+l)/;
s1=getarea(x,y,mid1);
double s2=getarea(x,y,mid2);
if(s1>s2)
l=mid2;
else
r=mid1;
}
printf("%.9lf\n",s1);
return ;
}
ural 1874 Football Goal的更多相关文章
- 三分--Football Goal(面积最大)
B - Football Goal Time Limit:500MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Su ...
- 1874 football game(三分法and method to compute the area of trianngle)
FInd the max area. 1. 三分法 2. NAN (not comparable with number) http://acm.timus.ru/problem.aspx?space ...
- ural 2067. Friends and Berries
2067. Friends and Berries Time limit: 2.0 secondMemory limit: 64 MB There is a group of n children. ...
- ural 2063. Black and White
2063. Black and White Time limit: 1.0 secondMemory limit: 64 MB Let’s play a game. You are given a r ...
- UVA 10194 Football (aka Soccer)
Problem A: Football (aka Soccer) The Problem Football the most popular sport in the world (america ...
- HDU-1225 Football Score
http://acm.hdu.edu.cn/showproblem.php?pid=1225 一道超级简单的题,就因为我忘记写return,就wa好久,拜托我自己细心一点. 学习的地方:不过怎么查找字 ...
- Ural 1313 - Some Words about Sport
Ural doctors worry about the health of their youth very much. Special investigations showed that a l ...
- D - Football (aka Soccer)
Football the most popular sport in the world (americans insist to call it "Soccer", but we ...
- American Football Vocabulary!
American Football Vocabulary! Share Tweet Share You’ll learn all about the vocabulary of American fo ...
随机推荐
- Android开发系列(十八):自己定义控件样式在drawable目录下的XML实现
在Android开发的过程中,我们常常须要对控件的样式做一下改变,能够通过用添加背景图片的方式进行改变,可是背景图片放多了肯定会使得APK文件变的非常大. 我们能够用自己定义属性shape来实现. s ...
- swift开发笔记24 解决键盘遮挡输入框 的方法
很简单,就是开始输入时把整个view的frame上移,也就是把y值减小就行了,至于减少多少自己调 ,也可以动态获取参见(http://blog.csdn.net/lengshengren/articl ...
- curl_setopt函数相关应用及介绍(转)
一.要想使用curl_setopt 这个函数必须在服务器里边进行编译curl这个组件,怎么安装编译这个组件请具体到google搜索 二.curl_setopt的php帮助文档的解释 bool curl ...
- SHELL网络爬虫实例剖析--转载
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://nolinux.blog.51cto.com/4824967/1552472 前天 ...
- java/php/c#版rsa签名以及java验签实现--转
在开放平台领域,需要给isv提供sdk,签名是Sdk中需要提供的功能之一.由于isv使用的开发语言不是单一的,因此sdk需要提供多种语言的版本.譬如java.php.c#.另外,在电子商务尤其是支付领 ...
- UITableView的编辑(插入、删除、移动)
先说两个方法beginUpdates和endUpdates,几点注意事项: 一般我们把行.块的插入.删除.移动写在由这两个方法组成的函数块中.如果你不是在这两个函数组成的块中调用插入.删除.移动方法, ...
- jquery实现图片切换和js实现图片切换
jquery实现图片切换: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http ...
- Windows系统下安装Python的SSH模块教程
Python中使用SSH需要用到OpenSSH,而OpenSSH依赖于paramiko模块,而paramiko模块又依赖于pycrypto模块,因此要在Python中使用SSH,则需要先安装模块顺序是 ...
- VS2013配置文件常见问题解决方法
1.C++ VS2013出现LINK : fatal error LNK1104: 无法打开文件“kernel32.lib,”错误,什么原因啊?原因:项目->XX(项目名称)属性->链接器 ...
- hdu_1875_畅通工程再续 prim和kruskal
这个题是个典型的最小生成树的题目,但是刚开始怎么都过不了,后来发现两种写法都有疏忽,但是prim的到目前为止不懂为什么刚开始的不对,kruskal算法,并查集的初始条件从0开始写成从1开始了,所以已知 ...