zoj 3203 Light Bulb (三分)
来源:互联网 发布:淮南市农村残疾人数据 编辑:程序博客网 时间:2024/06/05 10:56
Compared to wildleopard's wealthiness, his brother mildleopard is rather poor. His house is narrow and he has only one light bulb in his house. Every night, he is wandering in his incommodious house, thinking of how to earn more money. One day, he found that the length of his shadow was changing from time to time while walking between the light bulb and the wall of his house. A sudden thought ran through his mind and he wanted to know the maximum length of his shadow.
Input
The first line of the input contains an integer T (T <= 100), indicating the number of cases.
Each test case contains three real numbers H, h and D in one line. H is the height of the light bulb while h is the height of mildleopard. D is distance between the light bulb and the wall. All numbers are in range from 10-2 to 103, both inclusive, and H - h >= 10-2.
Output
For each test case, output the maximum length of mildleopard's shadow in one line, accurate up to three decimal places..
Sample Input
32 1 0.52 0.5 34 3 4
Sample Output
1.0000.7504.000求人从左向右走动时,影子的长度L的最大值
人在灯下的影子长度是0,这时他如果向前走的话,影子会逐渐变长,到最后人走到墙的位置的时候,影长度便是人的身高了,所以影长的变化曲线要么是单调递增的,要么是向上凸的,所以适合三分。(二分法作为分治中最常见的方法,适用于单调函数,逼近求解某点的值,当函数是凸性函数时,就得用三分)。
由于影长从灯下0一直到恰好没投影到墙上的过程是一个单调的过程,我们可以把这段忽略,直接求解,投影到墙上后,影长的变化即可。
- zoj 3203 Light Bulb(三分)
- ZOJ 3203 Light Bulb (三分算法)
- ZOJ 3203 Light Bulb(三分)
- zoj 3203 Light Bulb (三分)
- Zoj 3203 Light Bulb (三分查找)
- ZOJ 3203 Light Bulb (三分)
- zoj 3203 Light Bulb(三分)
- zoj 3203 Light Bulb(三分)
- zoj 3203 - Light Bulb (三分)
- zoj 3203 Light Bulb 三分
- ZOJ 3203 Light Bulb--三分
- 三分 --- ZOJ 3203 Light Bulb
- ZOJ 3203 Light Bulb 三分
- ZOJ 3203 Light Bulb——(三分求极值)
- ZOJ 3203 Light Bulb 三分查找
- zoj 3203 Light Bulb,三分基础题
- ZOJ 3203 Light Bulb 三分\推公式
- zoj 3203 Light Bulb 三分入门
- oracle 字符处理函数
- HDOJ 畅通工程 1232(并查集入门)
- 用django-pipeline为静态文件添加hash
- 用django-social-auth 做中国社交网站三方登录(qq,微博,豆瓣,百度,人人,微信支持)
- 用graphite diamond做监控
- zoj 3203 Light Bulb (三分)
- Java_日期操作_获取当前日期
- Discrete Fourier Transform
- Android string.xml 显示特殊符号
- 用QML开发Android APP(一)
- 斯坦福大学公开课 :机器学习课程(Andrew Ng)——11、无监督学习:the derivation of EM Algorithm
- 用Sublime写Lua时Cmd+R列不出某些函数的解决办法
- linux服务器apache环境下中文乱码的解决方案
- 用一段非常难懂的语句,但是很简洁的实现了一个很实用的函数。