【原创】【假分治】【数竞派来的卧底】UmBasketella POJ 3737

编程入门 行业动态 更新时间:2024-10-05 07:23:54

【原创】【假分治】【数竞派来的<a href=https://www.elefans.com/category/jswz/34/1766400.html style=卧底】UmBasketella POJ 3737"/>

【原创】【假分治】【数竞派来的卧底】UmBasketella POJ 3737

UmBasketella POJ 3737

题目

In recent days, people always design new things with multifunction. For instance, you can not only use cell phone to call your friends, but you can also use your cell phone take photographs or listen to MP3. Another example is the combination between watch and television. These kinds of multifunction items can always improve people’s daily life and are extremely favored by users.

The company Mr. Umbrella invented a new kind umbrella “UmBasketella” for people in Rainbow city recently and its idea also comes from such multifunction–the combination of umbrella and daily necessities. This kind of umbrella can be used as a basket and you can put something you want to carry in it. Since Rainbow city rains very often, such innovative usage is successful and “UmBasketella” sells very well. Unfortunately, the original “UmBasketella” do not have an automatic volume control technology so that it is easily damaged when users try to put too many things in it. To solve this problem, you are needed to design an “UmBasketella” with maximum volume. Suppose that “UmBasketella” is a cone-shape container and its surface area (include the bottom) is known, could you find the maximum value of the cone?

Input
Input contains several test cases. Eash case contains only one real number S, representing the surface area of the cone. It is guaranteed that 1≤S≤10000.

Output
For each test case, output should contain three lines.
The first line should have a real number representing the maximum volume of the cone.
Output the height of the cone on the second line and the radius of the bottom area of the cone on the third line.
All real numbers should rounded to 0.01.

Sample Input
30
Sample Output
10.93
4.37
1.55

题意

给定一个表面积一定的圆锥,求它最大的体积,以及此时的半径和高。

分析

你的好友【博主】使用技能:暴解(我可是学过立体几何的!)成功地暴解AC。

接下来的推导全是图片:






早知道我推出函数就不该求导直接三分了,啊啊啊!我第一次用几何画板用公式(就是那个没有经过化简的导函数)复制了一下就卡爆了电脑!!!

代码

#include<cstdio>
#include<cmath>
#define Pi acos(-1.0)
double S,V,R,h;//表面积,体积,半径,高
int main()
{while(~scanf("%lf",&S)){R=sqrt(S/Pi)/2;h=sqrt((S/Pi)*(S/Pi)/(R*R)-2*S/Pi);V=(Pi*R*R*h)/3;printf("%.2lf\n%.2lf\n%.2lf\n",V,h,R);}
}

//代码好简短哟(写代码的时间不到推导时间的十分之一)

更多推荐

【原创】【假分治】【数竞派来的卧底】UmBasketella POJ 3737

本文发布于:2024-02-27 20:37:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1766382.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:卧底   派来   UmBasketella   POJ

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!