Codeforces 630Q Pyramids
来源:互联网 发布:苹果mac复制粘贴全选 编辑:程序博客网 时间:2024/04/29 03:18
IT City administration has no rest because of the fame of the Pyramids in Egypt. There is a project of construction of pyramid complex near the city in the place called Emerald Walley. The distinction of the complex is that its pyramids will be not only quadrangular as in Egypt but also triangular and pentagonal. Of course the amount of the city budget funds for the construction depends on the pyramids' volume. Your task is to calculate the volume of the pilot project consisting of three pyramids — one triangular, one quadrangular and one pentagonal.
The first pyramid has equilateral triangle as its base, and all 6 edges of the pyramid have equal length. The second pyramid has a square as its base and all 8 edges of the pyramid have equal length. The third pyramid has a regular pentagon as its base and all 10 edges of the pyramid have equal length.
The only line of the input contains three integers l3, l4, l5 (1 ≤ l3, l4, l5 ≤ 1000) — the edge lengths of triangular, quadrangular and pentagonal pyramids correspondingly.
Output one number — the total volume of the pyramids. Absolute or relative error should not be greater than 10 - 9.
2 5 3
38.546168065709
求正三棱锥,正四棱锥,正五棱锥体积之和 分别计算出公式,然后带入
#include <iostream>#include<cstdio>#include<cstring>#include<cmath>#define Pi acos(-1.0)using namespace std;int main(){ double l3,l4,l5,v; while(~scanf("%lf%lf%lf",&l3,&l4,&l5)) { v=0; v+=sqrt(2)/4*l3*l3*l3/3; v+=sqrt(2)/2*l4*l4*l4/3; //printf("%.10lf\n",v); double x=(l5/2)/sin(36.0/360*2*Pi); double y=(l5/2*sin(54.0/360*2*Pi))/sin(36.0/360*2*Pi); //printf("%lf %lf\n",x,y); v+=5*l5*y/2*sqrt(l5*l5-x*x)/3; printf("%.10lf\n",v); } return 0;}
- Codeforces 630Q Pyramids
- CodeForces 630Q:Pyramids【几何】
- CodeForces 630Q Pyramids(数学公式)
- CodeForces 630 Q. Pyramids(计算几何)
- CodeForces - 630Q Pyramids (数学几何&公式)
- code forces 630 Q. Pyramids
- Codeforces 630Q
- Pyramids
- Pyramids
- codeforces#419 B q
- Codeforces Gym 101174 H. Pascal's Hyper-Pyramids (记忆化搜索)
- Image pyramids
- L - Pyramids
- sgu162:Pyramids
- q
- q
- q
- Q
- 图的深度优先遍历
- 集合类说明及区别
- k-近邻算法学习
- ExpandableTextView的问题
- Problem 1606 - Funny Sheep
- Codeforces 630Q Pyramids
- C++实现字符串数组作为函数的参数的反序输出
- 南阳理工ACM 2括号配对问题
- SQLiteOpenHelper类基础
- 插件化研究之资源冲突
- android架构篇(1)
- iOS——数据存取
- Hibernate---缓存策略
- zzuoj 10445: 魔法花园 【思维】