博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HDU 4798 Skycity【计算机几何】【阅读题】
阅读量:5825 次
发布时间:2019-06-18

本文共 2786 字,大约阅读时间需要 9 分钟。

Skycity

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


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?
 

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

给出一个圆台,给出底部半径R和顶部半径r,圆台高度为H,把圆台分成F份登高的小圆台,按每个圆台顶部的圆为标准,用多边形(推得必须是正多边形来保证相切)来围住这些圆,这些多边形都是垂直的帘子,并且给出每个帘子的最小面积S,所以有它们的面积,它们的面积就是它们的耗费。问要求的最小耗费是多少。

思路:所求多边形周长为,θ是多边形一个端点和圆心的连线与圆心和这条边中点连线的夹角。θ越大消耗越大,即边数越少,消耗越大。

对于每层,根据最小面积S得到最小边长x,得到可以得到的多边形的边数的最大值,然后算出周长即可。

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define INF 0x3f3f3f3f#define ms(a,b) memset(a,b,sizeof(a))using namespace std;const int maxn = 55;const int mod = 1e9 + 7;const double pi = acos(-1.0);typedef pair
P;typedef long long ll;typedef unsigned long long ull;double R, r, H, F, S;double cal(double r, double h){ int n = pi / atan(S / (2 * r*h)); return 2 * r*n*tan(pi / n);}int main(){ while (~scanf("%lf%lf%lf%lf%lf", &R, &r, &H, &F, &S)) { double h = H / F; double ans = 0; ans += cal(r, h)*h; for (int i = 1; i <= F - 1; i++) { double x = (R - r)*i / F + r; ans += cal(x, h)*h; } printf("%.3f\n", ans); }}

转载于:https://www.cnblogs.com/Archger/p/8451638.html

你可能感兴趣的文章
dedecms 修改标题长度可以修改数据库
查看>>
Matplotlib学习---用matplotlib画直方图/密度图(histogram, density plot)
查看>>
MySQL案列之主从复制出错问题以及pt-slave-restart工具的使用
查看>>
linux 查看剩余内存数
查看>>
测试人员容易遗漏的隐藏缺陷
查看>>
maven+SpringMVC搭建RESTful后端服务框架
查看>>
[BalkanOI2016]Cruise
查看>>
一本书的摘录
查看>>
重排序(转载)
查看>>
python+selenium之字符串切割操作
查看>>
串结构练习——字符串匹配
查看>>
linux下输入密码不回显
查看>>
《构建之法》读书笔记
查看>>
拿下阿里、头条、滴滴的offer后谈谈面试经验---动身前看一看
查看>>
android开发(49) android 使用 CollapsingToolbarLayout ,可折叠的顶部导航栏
查看>>
【ERP】如何在多行数据块中实现仅能勾选唯一的主联系人
查看>>
Oracle 数据库优化的R方法(Method R)
查看>>
CentOS最小化安装系统开启网卡
查看>>
互联网+升级到智能+ 开启万物智联新时代
查看>>
Nginx + Tomcat (java )服务器部署
查看>>