poj 1905 图形推算+二分
题意:
一根两端固定在两面墙上的杆 受热弯曲后变弯曲
求前后两个状态的杆的中点位置的距离
分析:见博客
代码:
#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 图形推算+二分的更多相关文章
- POJ 1905 Expanding Rods 二分答案几何
题目:http://poj.org/problem?id=1905 恶心死了,POJ的输出一会要lf,一会要f,而且精度1e-13才过,1e-12都不行,错了一万遍终于对了. #include < ...
- poj 1905 Expanding Rods 二分
/** 题解晚上写 **/ #include <iostream> #include <math.h> #include <algorithm> #include ...
- 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 ...
- POJ 3273 Monthly Expense二分查找[最小化最大值问题]
POJ 3273 Monthly Expense二分查找(最大值最小化问题) 题目:Monthly Expense Description Farmer John is an astounding a ...
- POJ - 1905 Expanding Rods(二分+计算几何)
http://poj.org/problem?id=1905 题意 一根两端固定在两面墙上的杆,受热后变弯曲.求前后两个状态的杆的中点位置的距离 分析 很明显需要推推公式. 由②的限制条件来二分角度, ...
- 【二分答案】Expanding Rods POJ 1905
题目链接:http://poj.org/problem?id=1905 题目大意:原长度为L的线段因受热膨胀为一段弧,线段L.弧长L'.温度n.膨胀率c满足L' =(1+n/c)*L;求线段的中点移动 ...
- poj 1905 Expanding Rods (数学 计算方法 二分)
题目链接 题意:将长度为L的棒子卡在墙壁之间.现在因为某种原因,木棒变长了,因为还在墙壁之间,所以弯成了一个弧度,现在求的是弧的最高处与木棒原先的地方的最大距离. 分析: 下面的分析是网上别人的分析: ...
- Expanding Rods POJ 1905 二分
Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 17050 Accepted: 4503 Description When ...
- POJ 1905 题解(二分+几何)
题面 传送门 分析 如图:已知AB=L,弧AB=L(1+nC)" role="presentation" style="position: relative;& ...
随机推荐
- 抓取猫眼TOP100的数据
import requests import re import json from multiprocessing import Pool from multiprocessing import M ...
- linux Cron 定时任务(centos 7.2 测试可用)
1.Cron(学习笔记) 计划任务,是任务在约定的时间执行已经计划好的工作. 格式如下 Seconds Minutes Hours DayofMonth Month DayofWeek Year ...
- goland 实用键
代码补全 option + command + v
- LINUX搭建网站环境教程
安装Mysql yum install mysql-server -y 启动Mysql service mysqld restart 此实验使用 mysql 默认账户名和密码,您也可以设置自己的 My ...
- mysql和sql server的按组连接
sqlserver : for xml path mysql :group_contact
- static变量与普通变量的异同
1.static局部变量与普通局部变量的异同 相同点:都是局部变量,在函数内部定义,仅能被该模块内部的语句所访问. 不同点: 1)内存分配与释放: static修饰的局部变量在内存中存放在静态存储区, ...
- Java中的LinkedHashSet
- shell脚本编写监控内存并发送邮件
1.准备发送邮件的工具: #!/usr/bin/python# -*- coding: UTF-8 -*-import sysimport smtplibimport email.mime.multi ...
- Vivado利用IP自带的示例工程和仿真
有时候想查看IP的特性和功能,又不想自己写testbench,Vivado自带的IP示例工程就能派上用场,原来一直不知道怎么打开IP的示例工程 第一步:在原有的工程中新建IP,按照你想要的IP属性,例 ...
- 贪心——cf708b
先求0,1的个数,然后贪心输出01即可 #include<bits/stdc++.h> using namespace std; #define ll long long ll a,b,c ...