HDU 4798 Skycity (计算几何+推公式) 2013 Asia Changsha Regional Contest
来源:互联网 发布:微信竞猜游戏源码 编辑:程序博客网 时间:2024/06/10 01:07
传送门
Skycity
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 538 Accepted Submission(s): 166
Problem Description
The world’s new tallest building is going to be built in Changsha, which will be called as "Skycity". The Skycity is going to be built as a circular truncated cone, radius of its bottom is marked as R, and radius of its top is marked as r, height of the building is marked as H, and there will be F floors with exact the same height in the whole building.
After construction of the building’s skeleton, the construction team is going to construct the curtain wall using thousands of glass panes. The curtain wall is installed in each floor. When installing the curtain wall in a floor, first the construction team will measure the radius r’ of the ceiling, then they will install the glass curtain wall as a regular prism which can exactly contain the ceiling circle. When constructing the glass curtain wall, all the glass pane has a minimum area requirement S, and amount of glass usage should be as little as possible.
As all the glass has exact the same thickness, so we can calculate the consumption of each glass pane as its area. Could you calculate the minimum total glass consumption?
After construction of the building’s skeleton, the construction team is going to construct the curtain wall using thousands of glass panes. The curtain wall is installed in each floor. When installing the curtain wall in a floor, first the construction team will measure the radius r’ of the ceiling, then they will install the glass curtain wall as a regular prism which can exactly contain the ceiling circle. When constructing the glass curtain wall, all the glass pane has a minimum area requirement S, and amount of glass usage should be as little as possible.
As all the glass has exact the same thickness, so we can calculate the consumption of each glass pane as its area. Could you calculate the minimum total glass consumption?
Input
There will be multiple test cases. In each test case, there will be 5 integers R, r (10 ≤ r < R ≤ 10000), H (100 ≤ H ≤ 10000), F (10 ≤ F ≤ 1000) and S (1 ≤ S <× r × H ÷ F) in one line.
Output
For each test case, please output the minimum total glass consumption, an absolute error not more than 1e-3 is acceptable.
Sample Input
50 10 800 120 5
300 50 2000 500 10
Sample Output
149968.308
2196020.459
题目大意:
给出一个圆台,给出底部半径
围住这些圆,并且给出每块矩形的最小面积
解题思路:
根据题意很明显可以推出来,一定是当围成的多边形是正多边形的时候才可以,然后在 yy 一下就 OK 了,但是一定要注意精度问题。
/**2016 - 09 - 23 晚上Author: ITAKMotto:今日的我要超越昨日的我,明日的我要胜过今日的我,以创作出更好的代码为目标,不断地超越自己。**/#include <iostream>#include <cstdio>#include <cstring>#include <cstdlib>#include <cmath>#include <vector>#include <queue>#include <algorithm>#include <set>using namespace std;typedef long long LL;typedef unsigned long long ULL;const LL INF = 1e17+5;const int MAXN = 1e6+5;const int MOD = 1e9+7;const double eps = 1e-8;const double PI = acos(-1.0);using namespace std;int main(){ double R, r, H, F, S; while(cin>>R>>r>>H>>F>>S) { double h = H / F; double k = S / h; double tmp = (R-r)/F; double sum = 0, i = r; for(int i=0; i<F; i++) { double RRR = r + i*tmp; int n = (int)(PI/atan(k/(2.0*RRR))); double tp = tan(PI/(1.0*n))*RRR*2; sum += n*tp*h; } printf("%.3lf\n",sum); } return 0;}
0 0
- HDU 4798 Skycity (计算几何+推公式) 2013 Asia Changsha Regional Contest
- HDU 4793 Collision(计算几何)——2013 Asia Changsha Regional Contest
- HDU 4791 Alice's Print Service(二分)——2013 Asia Changsha Regional Contest
- HDU 4794 Arnold (Fib数模 n 的应用)——2013 Asia Changsha Regional Contest
- HDU 4791 Alice's Print Service(2013 Asia Changsha Regional Contest)
- HDU 4798 Skycity(计算几何)
- The 2013 ACM-ICPC Asia Changsha Regional Contest KPocket Cube
- The 2013 ACM-ICPC Asia Changsha Regional Contest - A
- The 2013 ACM-ICPC Asia Changsha Regional Contest
- 2013 ACM/ICPC Asia Regional Changsha Online Contest C
- hdu 4798 Skycity(几何)
- HDU 4798 Skycity【几何】
- The 2013 ACM-ICPC Asia Changsha Regional Contest(2013区域赛练习)
- The 2013 ACM-ICPC Asia Changsha Regional Contest C Zoj Collision
- The 2013 ACM-ICPC Asia Changsha Regional Contest J Josephina and RPG
- 2013 ACM/ICPC Asia Regional Changsha Online
- 2013 Asia Chengdu Regional Contest
- 2013 Asia Hangzhou Regional Contest
- 当spring 容器初始化完成后执行某个方法
- (Android版)AR 现实增强 高通 Vuforia QCAR SDK环境搭建
- 微信步步为营,百度节节溃败
- 程序员面试宝典:螺旋队列第1题
- UVa 1368 DNA序列
- HDU 4798 Skycity (计算几何+推公式) 2013 Asia Changsha Regional Contest
- Centos 7 安装 chrome 软件的方法
- Different Ways to Add Parentheses
- 【UML】— 交互图
- 机器学习之五:随机森林算法及其Python实现
- Spring Aop增强
- I2S音频总线学习(二)I2S总线协议
- Android sqlitedatabase应该注意的地方
- IQKeyboardManager键盘管理