参考博客:

题意:

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

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

分析:见博客

代码:

#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. activiti7流程变量的测试(设置全局变量)

    package com.zcc.activiti03; import org.activiti.engine.*;import org.activiti.engine.repository.Deplo ...

  2. 安装项目依赖pipreqs并生成requirements.txt

    安装项目依赖:sudo pip3 install pipreqs 生成依赖文件(requirements.txt):pipreqs ./   # 进入项目目录,在项目文件夹里生成安装依赖文件里的环境: ...

  3. leetcode python两整数之和

    # Leetcode 371 两整数之和***### 题目描述 **不使用**运算符 `+` 和 `-` ​​​​​​​,计算两整数 `​​​​​​​a `.`b` ​​​​​​​之和. **示例1: ...

  4. Eureka 系列(08)心跳续约与自动过期

    Eureka 系列(08)心跳续约与自动过期 [TOC] Spring Cloud 系列目录 - Eureka 篇 在上一篇 Eureka 系列(07)服务注册与主动下线 中对服务的注册与下线进行了分 ...

  5. docker volume持久化存储与数据分享

    第一种 指定volume文件mysql存储,存储的位置为/var/lib/mysql -v mysql:/var/lib/mysql 第二种 同步文件,将容器中的skeleton文件夹的内容同步到宿主 ...

  6. 数据持久化之嵌入式数据库 SQLite(三)

    阿里P7Android高级架构进阶视频免费学习请点击:https://space.bilibili.com/474380680 SQLite 是 D. Richard Hipp 用 C 语言编写的开源 ...

  7. java入门之:Hello World

    import java.util.Scanner; public class HelloWorld{ public static void main(String[] args){ //向终端打印he ...

  8. window下eclipse搭建hadoop环境

    1 生成插件jar 1.1 安装java,ant运行环境 1.2 下载hadoop-2.5.0.tar.gz并解压到指定目录 1.3 下载hadoop2x-eclipse-plugin-master. ...

  9. bzoj4544 椭圆上的整点

    我会所有推理..... Q1:真的这么暴力的统计答案? Q2:蜜汁统计答案.... Q3:为什么不考虑3在不同的位置的情况

  10. bat批处理----set

    转载自    https://www.cnblogs.com/Braveliu/p/5081084.html [1]set命令简介 set,设置. [2]set命令使用 1. 打印系统环境变量.set ...