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 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…
Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 17050   Accepted: 4503 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 of heat expansion. When a thin rod is…
题目链接: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算出θ…
题目链接 题意:将长度为L的棒子卡在墙壁之间.现在因为某种原因,木棒变长了,因为还在墙壁之间,所以弯成了一个弧度,现在求的是弧的最高处与木棒原先的地方的最大距离. 分析: 下面的分析是网上别人的分析: 设弦长为L0(即原长),弧长为L1=(1+n*C)*l0,目标值为h,半径为R,弧所对圆心角为2θ(弧度制).可以得到以下方程组:圆的弧长公式:L1=2θR三角函数公式:L0=2*R*sinθ,变换得θ=arcsin(L0/(2*R))勾股定理:R^2=(R-h)^2+(0.5*L0)^2,变换得…
Expanding Rods Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 13780   Accepted: 3563 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 of heat expansion.  Wh…
Expanding Rods Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 20224 Accepted: 5412 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 of heat expansion. When a…
                                                                                                          Expanding Rods Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 13516   Accepted: 3484 Description When a thin rod of length L is he…
                       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…
UVA 10668 - Expanding Rods 题目链接 题意:给定一个铁棒,如图中加热会变成一段圆弧,长度为L′=(1+nc)l,问这时和原来位置的高度之差 思路:画一下图能够非常easy推出公式,设圆弧扇形部弧度r,那么能够计算出铁棒长度为lr/sin(r)这个公式在[0, pi/2]是单调递增的,所以能够用二分法去求解 要注意的一点是最后答案计算过程中带入mid,之前是带入x(二分的左边值),可实际上x是可能等于0的,而带入mid,因为是double型,所以mid实际上表示是一个很趋…
Expanding Rods Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 13688   Accepted: 3527 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 of heat expansion. Whe…