poj 1905Expanding Rods】的更多相关文章

题目地址:POJ 1905 题意:一根某种材料做的直杆被夹在两面墙之间,当他受热时长度变长,就会因两面墙的挤压而向上隆起.长度变化函数为 L'=(1+n*C)*L,给定L,C,n,求向上拱起的高度H. 思路: 手动计算出这两个公式,然后用二分查找h值. #include <stdio.h> #include <math.h> #include <string.h> #include <stdlib.h> #include <iostream> #…
/* 二分 + 几何 弧长L, 圆半径R, 弧度 q, L=R*q; 二分: 弧度(0~PI) 或者 高度(L/2~L) */ #include<cstdio> #include<iostream> #include<cmath> using namespace std; const double PI = acos(-1.0); double L, L1, T, C, R, Q; int main(){ || T!=- || C!=-)){ L1 = (+T*C)*L…
点击打开题目 题目大意 给定L,n,C,L为红色线段,L(1+n*C)为绿色弧,求两者中点的距离 二分圆心角度数,接下来就是几何的能力了 根据正弦定理,可得: Lsinθ=rsin(90°−θ) 则弧长: a=πr⋅θ180 将a与nL作比较来二分 精度满天飞 QWQ 代码如下: #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> double pi=3.1415926…
第一道:poj 1905Expanding Rods 题意:两道墙(距离L)之间架一根棒子,棒子受热会变长,弯曲,长度变化满足公式( s=(1+n*C)*L),求的是弯曲的高度h. 首先来看这个图: 如图,蓝色为杆弯曲前,长度为L 红色为杆弯曲后,长度为s h是所求. 又从图中得到三条关系式; (1)       角度→弧度公式  θr = 1/2*s (2)       三角函数公式  sinθ= 1/2*L/r (3)       勾股定理  r^2 – ( r – h)^2 = (1/2*…
D - Expanding Rods POJ - 1905 When a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coefficient of heat expansion. When a thin rod is mounted on two solid walls and then heated, it expands and takes…
                       Expanding Rods Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 10187   Accepted: 2593 Description When a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coefficient…
题目:http://poj.org/problem?id=1905 恶心死了,POJ的输出一会要lf,一会要f,而且精度1e-13才过,1e-12都不行,错了一万遍终于对了. #include <stdio.h> #include <math.h> int main() { double l, n, c, r; while(scanf("%lf %lf %lf", &l, &n, &c) != EOF) { && n &l…
http://poj.org/problem?id=1905 题意 一根两端固定在两面墙上的杆,受热后变弯曲.求前后两个状态的杆的中点位置的距离 分析 很明显需要推推公式. 由②的限制条件来二分角度,答案由①给出.注意,这种写法的精度要求较高. #include<iostream> #include<cmath> #include<cstring> #include<queue> #include<vector> #include<cstd…
                                                                                                          Expanding Rods Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 13516   Accepted: 3484 Description When a thin rod of length L is he…
题目链接:http://poj.org/problem?id=1905 题目大意:原长度为L的线段因受热膨胀为一段弧,线段L.弧长L'.温度n.膨胀率c满足L' =(1+n/c)*L;求线段的中点移动的最小距离. '?'代表的线段就是要求的距离. 怎么办呢?用分治,二分答案,验证弧长是否为目标弧长再进行调整. 首先利用相交弦定理[BA×EA=CA×DA]算出other(AE) 然后用(mid+other)/2得到r(CO) 再用r-mid(AO)除以r(CO)算出cos(θ) 再用acos算出θ…