Timer

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 445    Accepted Submission(s): 90

Problem Description
Recently, some archaeologists discovered an ancient relic on a small island in the Pacific Ocean. In the relic, they found an interesting cone shaped container with transparent bottom. The container lay on the horizontal ground with its central axis parallel to the ground. Just beside the container, they found a manual telling them something about the container. 
The container was a timer for a special ceremony. Ancient people filled it all with water before the ceremony, and when the ceremony began, they pulled out the plug in the small hole on the tip of the cone to let the water out. There was a horizontal line called “sacred line” carved on the bottom of the cone, and when the water level hit that line, they pushed the plug back and ended the ceremony. But the archaeologists could not found the sacred line on that cone. In order to sell the timer at a good prize, the archaeologists wanted to recover that very important line. 
By the manual they figured out how much water flew out when the ceremony ended, but they don’t know what to do next, so they come to you for help. 
They measures the height of the cone, and the diameter of the bottom, you should tell them the sacred line’s height above the ground. 
 
Input
The first line of the input contains an integer T(1<=T<=20), indicating the number of test cases.
Each line after that is a test case. It contains three real numbers, H, D(1<=H,D<=1000) and V, indicating the height and bottom diameter of the timer, and the volume of water that flew out during the ceremony. That volume is guaranteed to be less than half volume of the container.
 
Output
For each test case, output one line containing the height of the sacred line above the ground.
You should round off the answers to the 5th decimal place. (For example, rounding off 4.000005 equals to 4.00001 and rounding off 4.000004 equals to 4.00000)
 
Sample Input
2
5.0 10.0 0.0
5.0 10.0 65.4498
 
Sample Output
10.00000
5.00000
 
Source
 
数学题: 看了结题报告做的
代码:
 #include<stdio.h>
#include<stdlib.h>
#include<math.h>
const double ZERO =1e- ;
double H,D,V,R;
double calc(double r)
{
double h=R-r;
return H*R*R*acos(h/R)/ -h*H*sqrt(R*R-h*h)*/+h*h*h*H/R*log((R+sqrt(R*R-h*h))/h)/;
}
int main()
{
int cases =;
double l,r,mid;
scanf("%d",&cases);
while(cases--)
{
scanf("%lf%lf%lf",&H,&D,&V);
R=D/2.0;
l=; r=R;
while(r-l>=ZERO)
{
mid=(l+r)/;
if(calc(mid)<V) l=mid;
else r=mid;
}
printf("%.5lf\n",*R-(l+r)/2.0);
}
return ;
}

HDUOJ-------2493Timer(数学 2008北京现场赛H题)的更多相关文章

  1. HDUOJ----2485 Destroying the bus stations(2008北京现场赛A题)

    Destroying the bus stations                                                                          ...

  2. HDUOJ--------A simple stone game(尼姆博弈扩展)(2008北京现场赛A题)

    A simple stone game                                                                                  ...

  3. hdu-----2491Priest John's Busiest Day(2008 北京现场赛G)

    Priest John's Busiest Day Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Jav ...

  4. HDU 5119 Happy Matt Friends(2014北京区域赛现场赛H题 裸背包DP)

    虽然是一道还是算简单的DP,甚至不用滚动数组也能AC,数据量不算很大. 对于N个数,每个数只存在两个状态,取 和 不取. 容易得出状态转移方程: dp[i][j] = dp[i - 1][j ^ a[ ...

  5. 2018 ACM-ICPC 亚洲区域赛北京现场赛 I题 Palindromes

    做法:打表找规律 大数是过不了这个题的(但可以用来打表) 先找k的前缀,前缀对应边缘数字是哪个 如果第0位是2-9 对应奇数长度的1-8 第0位为1时,第1位为0时对应奇数长度的9,为1-9时对应偶数 ...

  6. Hihocoder 1634 Puzzle Game(2017 ACM-ICPC 北京区域赛 H题,枚举 + 最大子矩阵变形)

    题目链接  2017 Beijing Problem H 题意  给定一个$n * m$的矩阵,现在可以把矩阵中的任意一个数换成$p$,求替换之后最大子矩阵的最小值. 首先想一想暴力的方法,枚举矩阵中 ...

  7. 2015北京网络赛 H题 Fractal 找规律

    Fractal Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://hihocoder.com/contest/acmicpc2015beijingo ...

  8. hdu 4438 第37届ACM/ICPC 天津赛区现场赛H题

    题意:Alice和Bob两个人去打猎,有两种(只)猎物老虎和狼: 杀死老虎得分x,狼得分y: 如果两个人都选择同样的猎物,则Alice得分的概率是p,则Bob得分的概率是(1-p): 但是Alice事 ...

  9. hdu 4788 (2013成都现场赛 H题)

    100MB=10^5KB=10^8B 100MB=100*2^10KB=100*2^20B Sample Input2100[MB]1[B] Sample OutputCase #1: 4.63%Ca ...

随机推荐

  1. Cheatsheet: 2013 08.14 ~ 08.19

    .NET Lucene.Net ultra fast search for MVC or WebForms site => made easy! C# State Machines HttpCl ...

  2. eclipse下添加viplugin插件的方法

    http://www.viplugin.com/ 在eclipse根目录下建立文件:viplugin2.lic,然后在里面添加以下字符串: nd4UFjUMBADcUSeSW8ocLKoGP3lpbW ...

  3. NoSQL数据库的分布式模型

    NoSQL数据库的分布式模型 单一服务器 在一个服务器完全能够胜任工作时就没必要考虑分布式,这样部署简单,维护也方便很多: 分片 特点 数据的各个部分存放在集群的不同服务器中: 比如按字母来划分:以a ...

  4. 序列的方法(str,list,tuple)

    作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明.谢谢! 在快速教程中,我们了解了最基本的序列(sequence).回忆一下,序列包含有定值 ...

  5. php工具 phpstorm 的快捷键 的使用(待添加

    参考网址:http://www.cnblogs.com/jikey/p/3491798.html 1. ctrl+tab 键,可以切换各个选项卡 页面 2. shift+enter 键,无论光标在本行 ...

  6. UC打通高德POI数据,用大数据描绘周边热点地图

    UC打通高德POI数据,用大数据描绘周边热点地图   2016-10-25 11:13  来源:互联网  我来投稿  我要评论   在北京工作的小李最近很苦恼,房东因小区周边规划了大型商场而坚持涨价. ...

  7. STRUTS2 标签 循环次数

    *<s:property value="menus.size()"/> * <s:if test='menus.size()>8'>    sssss ...

  8. QQReg.java

    import java.awt.*; import javax.swing.*; public class QQReg extends JFrame{ public static void main( ...

  9. java实现excel与mysql的导入导出

    注意:编码前先导入poi相关jar包 1 /** * 读excel 到list * * @param file excel file * @param fields 字段数组 * @return * ...

  10. Python学习(19)正则表达式

    目录 Python 正则表达式 re.match 函数 re.search 方法 re.match 函数与 re.search 方法区别 检索和替换 正则表达式修饰符 - 可选标志 正则表达式模式 正 ...