POJ 1905 Expanding Rods 解题报告(二分)
来源:互联网 发布:同花顺云计算破解版 编辑:程序博客网 时间:2024/05/05 10:23
题目大意:求热胀后的弧的高度。
解题报告:二分很容易想,数学公式感觉才是难点。其实我一直很怀疑下面的代码的精度问题。当长度改变非常小时,r趋于无穷大,这时精度一定会有影响的。不多代码过了,偶没话说…………
#include <cstdio>#include <cstring>#include <cmath>using namespace std;const double eps=1e-5;int main(){ double L,h,c; double s; while(scanf("%lf%lf%lf",&L,&h,&c)) { if(L<0 && h<0 && c<0) break; s=L*(1+h*c); L/=2; double l=0; double r=L; while(r-l>eps) { double mid=(l+r)/2; double rr=(L*L+mid*mid)/(2*mid); if(2*rr*asin(L/rr)<s) l=mid; else r=mid; } printf("%.3lf\n",l); }}
- POJ 1905 Expanding Rods 解题报告(二分)
- pku 1905 二分 Expanding Rods 解题报告
- POJ-1905 Expanding Rods 解题报告
- POJ-1905 Expanding Rods 解题报告
- POJ-1905 Expanding Rods 解题报告(二分) 金属材料的膨胀
- poj 1905Expanding Rods(二分法)(解题报告)
- poj-1905 Expanding Rods (二分)
- POJ 1905 Expanding Rods(二分)
- POJ 1905 Expanding Rods(二分)
- POJ 1905Expanding Rods(计算二分)
- POJ 1905 Expanding Rods (二分)
- POJ - 1905 Expanding Rods (数学+二分)
- poj 1905 Expanding Rods(二分)
- POJ 1905 Expanding Rods(二分)
- POJ 1905 Expanding Rods(二分)
- POJ 1905 Expanding Rods(二分搜索)
- POJ 1905 Expanding Rods(二分)
- poj--1905 Expanding Rods(二分)
- WPF 图片裁剪
- oracle ebs 定义下载命令
- Android学习网站(1)
- .net使用DotNetCharting控件生成报表统计图总结
- codeforces 60B Serial Time!
- POJ 1905 Expanding Rods 解题报告(二分)
- 达芬奇TI DVSDK之视频数据流过程分析
- 九度笔记之 1455:珍惜现在,感恩生活
- PHP实现图片下载功能,浏览器直接保存
- Sturts2 传递一个参数问题
- Web开发者易犯的五大严重错误
- Android操作系统11种传感器介绍
- Ubuntu中一些常用快捷键
- hdu4105 Electric wave