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…
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…
描述 当长度为L的一根细木棍的温度升高n度,它会膨胀到新的长度L'=(1+n*C)*L,其中C是热膨胀系数. 当一根细木棍被嵌在两堵墙之间被加热,它将膨胀形成弓形的弧,而这个弓形的弦恰好是未加热前木棍的原始位置. 你的任务是计算木棍中心的偏移距离. 输入 三个非负实数:木棍初始长度(单位:毫米),温度变化(单位:度),以及材料的热膨胀系数. 保证木棍不会膨胀到超过原始长度的1.5倍. 输出 木棍中心的偏移距离(单位:毫米),保留到小数点后第三位. 样例输入 1000 100 0.0001 样例输…
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 mounted on two solid walls and then heated, it expands and takes the shape of a c…
http://poj.org/problem?id=1905 题意 一根两端固定在两面墙上的杆,受热后变弯曲.求前后两个状态的杆的中点位置的距离 分析 很明显需要推推公式. 由②的限制条件来二分角度,答案由①给出.注意,这种写法的精度要求较高. #include<iostream> #include<cmath> #include<cstring> #include<queue> #include<vector> #include<cstd…
题目: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…
题意:一个钢棍在两面墙之间,它受热会膨胀成一个圆弧形物体,这个物体长 S = ( 1 + n * C ) * L,现在给出原长 L ,温度改变量 n ,和热膨胀系数 C,求膨胀后先后中点的高度差. 思路:戳这里 -> 小優YoU巨巨写的题解挺好的! balabala: 1. 关键还是得找到变量之间的关系 2. 输出格式需要注意使用 fixed + setprecision 可以避免输出科学计数法形式的值 /*********************************************…
题目链接 题意:将长度为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,变换得…
/** 题解晚上写 **/ #include <iostream> #include <math.h> #include <algorithm> #include <cstdio> using namespace std; ; int main() { double l,n,c; while(cin>>l>>n>>c){ &&n<&&c<) break; double ll; l…
Jamie's Contact Groups Time Limit:7000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 2289 Description Jamie is a very popular girl and has quite a lot of friends, so she always keeps a very long contact list…
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: 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: 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…
UVA 10668 - Expanding Rods 题目链接 题意:给定一个铁棒,如图中加热会变成一段圆弧,长度为L′=(1+nc)l,问这时和原来位置的高度之差 思路:画一下图能够非常easy推出公式,设圆弧扇形部弧度r,那么能够计算出铁棒长度为lr/sin(r)这个公式在[0, pi/2]是单调递增的,所以能够用二分法去求解 要注意的一点是最后答案计算过程中带入mid,之前是带入x(二分的左边值),可实际上x是可能等于0的,而带入mid,因为是double型,所以mid实际上表示是一个很趋…
Problem A: Expanding Rods 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 the…
1137 - Expanding Rods    PDF (English) Statistics Forum Time Limit: 0.5 second(s) Memory Limit: 32 MB 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 thi…
题目:http://poj.org/problem?id=3273 二分枚举,据说是经典题,看了题解才做的,暂时还没有完全理解.. #include <stdio.h> #include <string.h> int n, m; ]; bool judge(int x) { , cnt = ; ; i < n; i++) { if(money + a[i] <= x) money += a[i]; else { money = a[i]; cnt++; } } if(c…
poj 1064 Cable master 判断一个解是否可行 浮点数二分 题目链接: http://poj.org/problem?id=1064 思路: 二分答案,floor函数防止四舍五入 代码: #include <iostream> #include <stdio.h> #include <math.h> #include <algorithm> using namespace std; const int maxn = 10005; const…
 Steady Cow Assignment Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 3189 Description Farmer John's N (1 <= N <= 1000) cows each reside in one of B (1 <= B <= 20) barns which, of co…
Optimal Milking Time Limit:2000MS     Memory Limit:30000KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 2112 Description FJ has moved his K (1 <= K <= 30) milking machines out into the cow pastures among the C (1 <= C <= 20…
题目链接: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算出θ…
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…
点击打开题目 题目大意 给定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…
http://www.lightoj.com/volume_showproblem.php?problem=1137 题意:一根长度为L的杆热膨胀为L',左端点到右端点间距离不变,且膨胀后的杆的弧为圆形的一部分. 思路:由于弧度值是固定在0~PI间,所以直接二分弧度制,通过初中学的弧度公式换算一下就行了,之前精度总是达不到要求,其实eps设的更小点就行了... /** @Date : 2016-12-11-21.41 * @Author : Lweleth (SoungEarlf@gmail.c…
转载请注明出处:優YoU http://user.qzone.qq.com/289065406/blog/1301845324 大致题意: 一根两端固定在两面墙上的杆 受热弯曲后变弯曲.求前后两个状态的杆的中点位置的距离 解题思路: 几何和二分的混合体 如图,蓝色为杆弯曲前,长度为L.红色为杆弯曲后,长度为s.h是所求 依题意知 S=(1+n*C)*L 又从图中得到三条关系式; (1)       角度→弧度公式  θr = 1/2*s (2)       三角函数公式  sinθ= 1/2*L…
Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 10287   Accepted: 2615 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=1 #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; ; double n,c,l; int main() { &&n!=-&&c!=-){ +n*c)*l; ,high=0.5*l,mid; while(high-low>eps) {…
题目链接:https://vjudge.net/problem/POJ-1905 题意:有一根长len的木棍,加热了n度,长度会膨胀为len*(1+n*c),c为膨胀系数.现在把这根木棍夹在两堵墙之间,木棍会向上弯曲变成弧形,求弧形中点和原木棍中点的高度差. 思路:刚开始以为是几何题,几何肯定是能做的.然后发现题解是二分,第一次二分double类的变量,学到了.设所求答案为dis,通过dis可以勾骨出半径R,然后求出弧长L,再比较L与真实弧长len.显然dis和L满足二分的单调性,那么就可以做了…
参考博客: 题意: 一根两端固定在两面墙上的杆 受热弯曲后变弯曲 求前后两个状态的杆的中点位置的距离 分析:见博客 代码: #include<stdio.h> #include<iostream> #include<algorithm> #include<math.h> #include<string.h> #include<iomanip> using namespace std; //const double esp=1e-5;…