poj 1905
来源:互联网 发布:天子网络 编辑:程序博客网 时间:2024/05/17 23:12
#include<iostream>#include<math.h>#include<iomanip>#include<cstdio>using namespace std;#define eps 1e-6double L,h,s;int ok(double x)//一不小心就写成int了 精度达不到{ return 2*x*asin(L/(2*x)) < s;}int main(){ double n,c; while(cin>>L>>n>>c) { if(L<0 && n<0 && c<0) break; double l=0.0,r=L*0.5; double mid; s=(1+n*c)*L; while(r-l>1e-6) { mid=(l+r)/2; r=(4*mid*mid+L*L)/(8*mid); if(ok(r)) l=mid; else r=mid; } h=mid; printf("%.3lf\n",h); } return 0;}
0 0
- POJ 1905
- POJ 1905
- poj 1905
- POJ 1905
- poj 1905
- poj 1905
- poj 1905
- POJ-1905
- POJ 1905
- POJ 1905
- POJ 1905 Expanding Roads
- poj-1905 Expanding Rods
- POJ 1905,3122,3273
- poj 1905 Expanding Rods
- 二分法 poj 1905
- POJ 1905 Expanding Rods
- poj 1905 二分
- poj 1905
- xenserver 恢复从pool中删除的机器状态
- bug-Gallery2-menu-No1-20160818
- coding.net项目管理
- Bootstrap 关于背景图像的自适应和行的栅格化
- Matrix
- poj 1905
- echarts图表showLoading遮盖层显示问题
- 每日一记-防止重复提交
- jzoj 2050. 【8.18】游戏
- C++笔记
- codechef SHORT
- Ubuntu中更改所有子文件和子目录所有者权限
- Adding Animations之Animating Layout Changes
- 老毛桃2014装win8.1.iso