题目链接: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. 从jscript脚本混淆说起

    转载:http://www.freebuf.com/column/144897.html 脚本病毒是一个一直以来就存在,且长期活跃着的一种与PE病毒完全不同的一类病毒类型,其制作的门槛低.混淆加密方式 ...

  2. java基础练习 20

    import java.util.Scanner; public class Twentieth { /*某个公司采用公用电话传递数据,数据是四位的整数,在传递过程中是加密的,加密规则如下:每位数字都 ...

  3. Centos 6.3nginx安装

    1. 增加源: vi /etc/yum.repos.d/nginx.repo CentOS: [nginx] name=nginx repo baseurl=http://nginx.org/pack ...

  4. 引进js文件运行在浏览器上调试报文件找不到

    原因是jsp文件的路径和js文件不在同一目录下,用"../"将它们的路径配置在同一路径下或者在路径前面加上"<%= request.getContextPath() ...

  5. Selenium2+python自动化19-单选框和复选框(radiobox、checkbox)【转载】

    本篇主要介绍单选框和复选框的操作 一.认识单选框和复选框 1.先认清楚单选框和复选框长什么样 2.各位小伙伴看清楚哦,上面的单选框是圆的:下图复选框是方的,这个是业界的标准,要是开发小伙伴把图标弄错了 ...

  6. ssh登录服务器免密钥

    我有三台Linux,IP分别为a:10.0.0.20/b:10.0.0.50/c:10.0.0.60/d:10.0.0.70 # a为本地主机  b c d为远程主机 #在a上生成密钥对(3次回车出现 ...

  7. 处理下最近的file_id小写问题

    update t_resource_info set FILE_ID = UPPER(FILE_ID);update t_resource_my_info set FILE_ID = UPPER(FI ...

  8. DB2—alter追加/删除/重置column操作

    DB2—alter追加/删除/重置column操作   1.添加字段   alter table 表名称 add 字段名称 类型   Demo: 1 alter table table_name  a ...

  9. uva12265 贩卖土地 单调栈

    输入一个n*m的矩阵,每个格子可能是空地,也可能是沼泽.对于每个空地格子,求出以它为右下角的空矩形的最大周长,然后统计每个周长出现了多少次. 输入包含多组测试数据,第一行输入一个正整数N,表示输入样例 ...

  10. 计蒜客 28201.Choosing Ice Cream-gcd (BAPC 2014 Preliminary ACM-ICPC Asia Training League 暑假第一阶段第一场 A)

    开始水一波博客 题目链接: A. Choosing Ice Cream 传送门 题意就是n个冰淇淋,骰子有k个面,问你是否能在公平的概率下转几次骰子能确定买哪个冰淇淋. 举个例子,假设我只有一个冰淇淋 ...