poj 2405 Beavergnaw
| Time Limit: 1000MS | Memory Limit: 65536K | |
| Total Submissions: 6310 | Accepted: 4158 |
Description

When chomping a tree the beaver cuts a very specific shape out of the tree trunk. What is left in the tree trunk looks like two frustums of a cone joined by a cylinder with the diameter the same as its height. A very curious beaver tries not to demolish a tree but rather sort out what should be the diameter of the cylinder joining the frustums such that he chomped out certain amount of wood. You are to help him to do the calculations. We will consider an idealized beaver chomping an idealized tree. Let us assume that the tree trunk is a cylinder of diameter D and that the beaver chomps on a segment of the trunk also of height D. What should be the diameter d of the inner cylinder such that the beaver chmped out V cubic units of wood?
Input
Output
Sample Input
10 250
20 2500
25 7000
50 50000
0 0
Sample Output
8.054
14.775
13.115
30.901
Source
分析:
数学题
#include<iostream>
#include<queue>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
#define pi 3.1415926
int main(){
double d,v;
while(cin>>d>>v){
if(d==&&v==){
break;
}
double a=d*d*d-6.0*v/pi;
a=pow(a,1.0/);
printf("%.3f\n",a); //写成printf("%.3lf\n",a);是错的
}
return;
}
poj 2405 Beavergnaw的更多相关文章
- POJ 2405 Beavergnaw (计算几何-简单的问题)
Beavergnaw Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6203 Accepted: 4089 Descri ...
- POJ 2405
#include <iostream> #include <cmath> #include <iomanip> #define pi 3.1415926536 us ...
- poj 题目分类(1)
poj 题目分类 按照ac的代码长度分类(主要参考最短代码和自己写的代码) 短代码:0.01K--0.50K:中短代码:0.51K--1.00K:中等代码量:1.01K--2.00K:长代码:2.01 ...
- POJ题目分类(按初级\中级\高级等分类,有助于大家根据个人情况学习)
本文来自:http://www.cppblog.com/snowshine09/archive/2011/08/02/152272.spx 多版本的POJ分类 流传最广的一种分类: 初期: 一.基本算 ...
- POJ题目细究
acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP: 1011 NTA 简单题 1013 Great Equipment 简单题 102 ...
- 转载:poj题目分类(侵删)
转载:from: POJ:http://blog.csdn.net/qq_28236309/article/details/47818407 按照ac的代码长度分类(主要参考最短代码和自己写的代码) ...
- POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理
Halloween treats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7644 Accepted: 2798 ...
- POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理
Find a multiple Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7192 Accepted: 3138 ...
- POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治
The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22286 ...
随机推荐
- 《JavaScript权威指南》(第6版)翻译错误集 更新中。。。
§6.2.2 P126 原文:If o inherits x,and that property is an accessor property with a setter method. 原译:如 ...
- oracle-01427
Oracle / PLSQL: ORA-01427 Learn the cause and how to resolve the ORA-01427 error message in Oracle. ...
- hihocoder1634 Puzzle Game
题目链接:(vjudge) 戳我 和上面那个matrix 比较像. 大概题意就是给你一个n*m的矩阵,然后可以选择其中一个数字进行修改(当然也可以不修改),使得矩阵的最大子矩阵尽可能小.最后输出这个值 ...
- 实验1 C语言运行环境的使用和数据类型、运算符和表达式
Part1 这一部分的内容虽然简单,但是对于初学的我来说,独自完成且没有错误还是不容易的,像老师说的一样,只有自己亲手编写以后才可以发现问题并且逐步改正.从这次实践我对与C语言程序的结构更加熟悉. ...
- XMPP后台搭建
XMPP的环境搭建 1.下载MySQL 登录myql官网,点击页面下面的按钮 然后安装. 2.安装MySQL图形化管理工具mysql-workbench 同样进入mysql的官网, 下载 http:/ ...
- ArchLinux pacman 提高俩倍下载速度方法
pacman能够调用外部下载工具来代替默认的wget来给pacman提速 比如将/etc/pacman.conf中 XferCommand = /usr/bin/wget –passive-ftp - ...
- 关于java中String的用法
在java 中String存在许多的基本函数,接下来了解一下这些函数的基本用法 String.equals用法(这个用法比较难) String类中的equals()方法: public boolean ...
- 编程开发之--Oracle数据库--存储过程使用动态参数绑定(3)
1.动态参数绑定,可以实现动态的执行不同的sql --创建包 create or replace PACKAGE MYPACKAGE AS type empcursor is ref cursor; ...
- TX2 内核编译
准备工作 版本:jetpack3.1,R28.1,TX2 虚拟机:ubuntu14.04 参考文档.编译工具链.源码下载 编译 主要步骤记载如下: export CROSS_COMPILE=<c ...
- FPGA基础学习(8) --内部结构之存储单元
目录 1. 基本结构 2. BRAM与DRAM的比较 3. BRAM的特点 4. Block Memory的使用 4.1 配置为RAM或ROM 4.2. 配置为FIFO 参考文献: 上一篇中提到了SL ...