参考博客:

题意:

一根两端固定在两面墙上的杆 受热弯曲后变弯曲

求前后两个状态的杆的中点位置的距离

分析:见博客

代码:

#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string.h>
#include<iomanip>
using namespace std;
//const double esp=1e-5;
int main()
{
double L,n,c,s,r,h;
while(~scanf("%lf %lf %lf",&L,&n,&c))
{
if(L<&&n<&&c<)
break;
//
s=L*(+n*c);
double low=0.0;
double high=L*0.5;
double mid;// printf("%lf\n",s);
while(high-low>0.00001)
{
mid=(high+low)/;
r=(*mid*mid+L*L)/(*mid);
if(*r*asin(L/(*r))<s)
low=mid;
else
high=mid;
}
h=mid;
cout<<fixed<<setprecision()<<h<<endl;
//printf("%.3f\n",mid);
}
}

poj 1905 图形推算+二分的更多相关文章

  1. POJ 1905 Expanding Rods 二分答案几何

    题目:http://poj.org/problem?id=1905 恶心死了,POJ的输出一会要lf,一会要f,而且精度1e-13才过,1e-12都不行,错了一万遍终于对了. #include < ...

  2. poj 1905 Expanding Rods 二分

    /** 题解晚上写 **/ #include <iostream> #include <math.h> #include <algorithm> #include ...

  3. D - Expanding Rods POJ - 1905(二分)

    D - Expanding Rods POJ - 1905 When a thin rod of length L is heated n degrees, it expands to a new l ...

  4. POJ 3273 Monthly Expense二分查找[最小化最大值问题]

    POJ 3273 Monthly Expense二分查找(最大值最小化问题) 题目:Monthly Expense Description Farmer John is an astounding a ...

  5. POJ - 1905 Expanding Rods(二分+计算几何)

    http://poj.org/problem?id=1905 题意 一根两端固定在两面墙上的杆,受热后变弯曲.求前后两个状态的杆的中点位置的距离 分析 很明显需要推推公式. 由②的限制条件来二分角度, ...

  6. 【二分答案】Expanding Rods POJ 1905

    题目链接:http://poj.org/problem?id=1905 题目大意:原长度为L的线段因受热膨胀为一段弧,线段L.弧长L'.温度n.膨胀率c满足L' =(1+n/c)*L;求线段的中点移动 ...

  7. poj 1905 Expanding Rods (数学 计算方法 二分)

    题目链接 题意:将长度为L的棒子卡在墙壁之间.现在因为某种原因,木棒变长了,因为还在墙壁之间,所以弯成了一个弧度,现在求的是弧的最高处与木棒原先的地方的最大距离. 分析: 下面的分析是网上别人的分析: ...

  8. Expanding Rods POJ 1905 二分

    Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 17050   Accepted: 4503 Description When ...

  9. POJ 1905 题解(二分+几何)

    题面 传送门 分析 如图:已知AB=L,弧AB=L(1+nC)" role="presentation" style="position: relative;& ...

随机推荐

  1. Cocos2d之运行Test项目

    |   版权声明:本文为博主原创文章,未经博主允许不得转载. 1. 打开Test项目 路径为   C:\Dev\cocos2d-x-3.8.1\build 2.设定cpp-tests为启动项(当cpp ...

  2. 用java api 实现查询 Hive 数据

    版本:cdh5.4.7, hive1.1.0 pom文件 <dependency> <groupId>org.apache.hive</groupId> <a ...

  3. 响应式web开发的一些文章

    CSS Device Adaptation:关注 W3C 建议的 CSS 设备适配标准. “在 CSS 中使用 LESS 实现更多的功能”(作者:Uche Ogbuji,developerWorks, ...

  4. 手动安装easy-install/pip

    1.wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py 2.在root用户下 python ez_setup.py -- ...

  5. android 自定义标题

    public class MainActivity extends Activity { /** Called when the activity is first created. */ @Over ...

  6. tooltip(提示框)组件

    一.class加载方式 <span id="pos" class="easyui-tooltip" title="这是提示内容"> ...

  7. LeetCode Array Easy 66. Plus One

    Description Given a non-empty array of digits representing a non-negative integer, plus one to the i ...

  8. scss定义全局变量引入sass-resources-loader报错

    开发jquery多页应用,引入sass-resources-loader后报 Make sure 'options.resources' is String or Array of Strings. ...

  9. 面试之加分项vue(没看懂,。。。。)

    对大部分人来说,掌握Vue.js基本的几个API后就已经能够正常地开发前端网站.但如果你想更加高效地使用Vue来开发,成为Vue.js大师,那下面我要传授的这五招你一定得认真学习一下了.在面试过程很多 ...

  10. js实现点击按钮控制展开与收起.

    html <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <ti ...