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 ...
随机推荐
- ORM,Entity Framework介绍以及其所包含的基础架构介绍
一:entity framework 6.0 ORM (实体关系模型) O: Domain Object 领域模型 R: Relational Database 关系型数据库 M: Mapping 映 ...
- spring boot 整合 HttpClient
第一步:引入HttpClient 的jar包 1.httpClient 5.0 开始支持异步(Async)请求: 2.httpclient 版本过低上传文件会出,原因是 org.apache.http ...
- Java中String、StringBuffer和StringBuilder之间的区别
String在Java中是字符串常量 例如 String str = "abc"; str = str + 1; System.out.println(str); 结果将是abc1 ...
- BT Tracker的原理及.Net Core简单实现Tracker Server
最近很忙,自上次Blog被盗 帖子全部丢失后也很少时间更新Blog了,闲暇在国外站点查阅资料时正好看到一些Tracker 的协议资料,也就今天记录并实践了下,再次分享给大家希望可以帮到需要的小伙伴. ...
- java简答题
1.什么是java的平台无关性? Java源文件被编译成字节码的形式,无论在什么系统环境下,只要有java虚拟机就能运行这个字节码文件.也就是一处编写,处处运行.这就是java的跨平台性. 2.在一台 ...
- luogu1357花园(矩阵运算)(状压DP)
不得不说本蒻做这个题目的时候内心是很蒙蔽的qwq 推了规律找错了结果还没有暴力的分数高qwq...... 开数组\(f[i][j]\)来记录前i个花圃,(这里运用到状压的思想)其中最近的m个的状态(二 ...
- Excel一对多查询(index+small+if)
一.学习 一对多查询模式化数组公式: =INDEX(区域,SMALL(IF(条件,行号数组,4^8),ROW(A1))) 三键齐按(ctrl+shift+回车) 在具有多个符合条件的情况下,提取和匹配 ...
- jQuery判断表单input
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- JVM_垃圾收集器
最近刚好有时间,就简单的看了下JVM的几种垃圾回收器,它们都是计算机历史发展的产物,先简单的做一个整理,并没有哪一款垃圾收集器就一定是最优,还需要结合使用场景.参数配置等进行考量,根据系统情况搭配出尽 ...
- [Maven实战-许晓斌]-[第三章] Mave使用入门
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://mave ...