题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1984

1984. Dummy Guy

Time limit: 0.5 second

Memory limit: 64 MB

Every year students of our university participate in Regional Contest in Saint Petersburg. Train journeys from Yekaterinburg to Saint Petersburg make students very thirsty, so they usually take a lot
of drinks with them. But the director of Institute of Mathematics and Computer Sciences doesn’t like when students carry all these bottles. So the students try to hide their bottles from the director. The Psych Up team invented a special device for that: a
dummy guy.
The very first journey showed that the dummy guy can hardly hide two bottles. So you have decided to make a new dummy guy. You have nbottles that can be considered as cylinders of a unit radius.
At first you want to draw a circle and place all your bottles inside it so that each of the bottle bottoms touches the circle. What is the minimum radius of such circle?

Input

The only line contains an integer n that is the number of bottles (1 ≤ n ≤ 10).

Output

Output the minimum radius of a circle with an absolute or relative error not exceeding 10−6.

Sample

input output
2
2

题意:

求一个大圆能包括n个半径为一的小圆的最小半径!

PS:

把每一个小圆的圆心连起来就是一个正n多边形,就是求多边形中心到顶点的距离,画一条与小圆相切的切线,构成一个直角三角形,用正弦定理就能够求出来。再加上一个小圆的半径1。就好了,绘图就明确了!

代码例如以下:

#include <cstdio>
#include <cmath>
#define PI acos(-1.0)
int main()
{
int n;
while(~scanf("%d",&n))
{
if(n == 1)
{
printf("1\n");
continue;
}
double ans = 1.0/(sin(PI*1.0/n));
ans += 1;
printf("%.6lf\n",ans);
}
return 0;
}

URAL 1984. Dummy Guy(数学啊)的更多相关文章

  1. URAL 1161 Stripies(数学+贪心)

    Our chemical biologists have invented a new very useful form of life called stripies (in fact, they ...

  2. URAL 2047 Maths (数学)

    对于一个数来说,它的除数是确定的,那么它的前驱也是确定的,而起点只能是1或2,所以只要类似筛法先预处理出每个数的除数个数 ,然后递推出每个数往前的延伸的链长,更新最大长度,记录对应数字.找到maxn以 ...

  3. URAL 1731. Dill(数学啊 )

    题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1731 1731. Dill Time limit: 0.5 second Memory ...

  4. URAL 1826. Minefield(数学 递归)

    题目链接:http://acm.timus.ru/problem.aspx? space=1&num=1826 1826. Minefield Time limit: 0.5 second M ...

  5. URAL 1876 Centipede's Morning(数学)

    A centipede has 40 left feet and 40 right feet. It keeps a left slippers and b right slippers under ...

  6. URAL 1820. Ural Steaks(数学啊 )

    题目链接:space=1&num=1820" target="_blank">http://acm.timus.ru/problem.aspx? space ...

  7. ural 2029 Towers of Hanoi Strike Back (数学找规律)

    ural 2029 Towers of Hanoi Strike Back 链接:http://acm.timus.ru/problem.aspx?space=1&num=2029 题意:汉诺 ...

  8. ural 2032 Conspiracy Theory and Rebranding (数学水题)

    ural 2032  Conspiracy Theory and Rebranding 链接:http://acm.timus.ru/problem.aspx?space=1&num=2032 ...

  9. URAL 2067 Friends and Berries (推理,数学)

    题意:给定 n 个人,每个人两个值s, r,要满足,p(v, u) = sqrt((sv − su)^2 + (rv − ru)^2), p(v,u,w) = (p(v,u) + p(v,w) + p ...

随机推荐

  1. 结构型设计模式之组合模式(Composite)

    结构 意图 将对象组合成树形结构以表示“部分-整体”的层次结构.C o m p o s i t e 使得用户对单个对象和组合对象的使用具有一致性. 适用性 你想表示对象的部分-整体层次结构. 你希望用 ...

  2. Cocos2d-x中图字原理之深入分析

    http://cache.baiducontent.com/c?m=9d78d513d9921cfe05ac94281a16a632451294247c89df4f3992d15f9217465c02 ...

  3. (wifi)wifi移植之命令行调试driver和supplicant

    前言 小弟从事android wifi framework部分开发已经有一年的时间了,虽然感觉什么都没有学习到,但是回想起刚接手android wifi时候的那份无知,其实肚子里面还是有点东西的,本着 ...

  4. mysql 共享空间转为独立表空间

    由于以前的mysql配置为共享表空间,服务器空间不足,清理日志表里的数据后,数据库并没缩小,照成空间浪费,现在修改为独立表空间 #独立表空间innodb_file_per_table=1 #停止事物日 ...

  5. 使用VMware 管理服务器

    使用VMware 管理服务器 实验室有一台浪潮服务器.师兄只留下了开机用户名和密码,和一个VMware vSphere Client的安装包,就把它托付给了我.就是这样一个方方正正的长方体,只提供了接 ...

  6. RobotFramework自动化3-搜索案例【转载】

    本篇转自博客:上海-悠悠 原文地址:http://www.cnblogs.com/yoyoketang/tag/robotframework/ 前言 RF系列主要以案例为主,关键字不会的可以多按按F5 ...

  7. 集合框架(02)List

    List的类型和特点: ArrayList:底层的数据结构使用的是数组结构.特点:查询的速度很快,但是增删稍慢 线程不同步 LinKedList:底层使用的链表数据结构.特点:增删的速度很快,查询稍慢 ...

  8. 廖雪峰的git教程

    http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000

  9. springMVC初探视图解析器——ResourceBundleViewResolver

    视图解析器ResourceBundleViewResolver是根据proterties文件来找对应的视图来解析”逻辑视图“的, 该properties文件默认是放在classpath路径下的view ...

  10. vs2012 webservice创建

    第一步:打开VS2012,新建空项目,注意选择.NET Framework的版本.这里我选择的是.NET Framework 4 新建好项目后,在项目中添加一个WebService项 打开这个文件,我 ...