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 ...
随机推荐
- H - Can you answer these queries? - (区间查询更新)
有一列数,(都是2^63范围内的并且都大于0的整数),现在呢有一些操作, 操作 0 可以把区间LR内的所有数都变成它的平方根数(是取整后的),操作 1 可以就是求区间LR内的和了. 分析:因为这个操作 ...
- linux上使用netstat查看当前服务和监听端口
netstat这个命令常用在网络监控方面.利用这个命令,可以查看当前系统监听的服务和已经建立的服务,以及相应的端口.协议等信息. netstat参数说明 netstat参数虽然很多,但是常用的不多,主 ...
- 路由器的nat模式、路由模式和全模式
NAT模式.此模式下,由局域网向广域网发送的数据包默认经过NAT转换,但路由器对所有源地址与局域网接口不在同一网段的数据包均不进行处理.例如,路由器LAN口IP设置为192.168.1.1,子网掩码为 ...
- Highcharts下载与使用_数据报表图
Highcharts简介 Highcharts:功能强大.开源.美观.图表丰富.兼容绝大多数浏览器的纯js图表库 Highcharts是一款纯javascript编写的图表库,能够很简单便捷的在Web ...
- tcp/ip状态图
开启一个连接需要三次握手,终止一个tcp连接需要4次握手,对应的客户端和服务器连接状态也随之而改变. 1.服务器出现大量的CLOSE_WAIT? 通常,CLOSE_WAIT 状态在服务器停留时间很短, ...
- 一种基于重载的高效c#上图片添加文字图形图片的方法
在做图片监控显示的时候,需要在图片上添加文字,如果用graphics类绘制图片上的字体,实现图像上添加自定义标记,这种方法经验证是可行的,并且在visual c#2005 编程技巧大全上有提到,但是, ...
- [转] 智能指针(三):unique_ptr使用简介
PS: 1. auto_ptr太不安全,可能多个auto_ptr指向一个对象,出现重复释放的问题 2. unique_ptr解决了这个问题,不允许拷贝构造函数和赋值操作符,但是!它支持移动构造函数,通 ...
- 在PHP中使用CURL,“撩”服务器只需几行——php curl详细解析和常见大坑
在PHP中使用CURL,"撩"服务器只需几行--php curl详细解析和常见大坑 七夕啦,作为开发,妹子没得撩就"撩"下服务器吧,妹子有得撩的同学那就左拥妹子 ...
- 从零基础入门JavaScript(2)
在上次的学习当中,我已经对JavaScript有了一定基础上的理解,比如:JavaScript的发展史,JavaScript中变量的命名,各种运算符,以及数据的类型与它们之间的转化.还有就是一些最基本 ...
- css3 3D变换和动画
3D变换和动画 建立3D空间,transform-style: preserve-3d perspective: 100px; 景深 perspective-origin:center center ...