题目链接: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. sqlite3数据库 sqlite3_get_table

    上一篇介绍的sqlite3_exec 是使用回调来执行对select结果的操作.还有一个方法可以直接查询而不需要回调.但是,我个人感觉还是回调好,因为代码可以更加整齐,只不过用回调很麻烦,你得声明一个 ...

  2. Centos 6.3软件安装

    一.软件安装包的类型: 1. tar包,如software-1.2.3-1.tar.gz.它是使用UNIX系统的打包工具tar打包的. 2. rpm包,如software-1.2.3-1.i386.r ...

  3. ubuntu默认用户分析

    harvey@ubuntu:/etc$ cat -b passwd root:x:::root:/root:/bin/bash daemon:x:::daemon:/usr/sbin:/bin/sh ...

  4. 测试 System.SysUtils.TStringHelper

    来自:http://www.cnblogs.com/del/archive/2013/06/14/3135002.html -------------------------------------- ...

  5. hdu 1217(Floyed)

    Arbitrage Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total S ...

  6. springBoot Ribbon Hystrix Dashboard

    1.引入依赖 <!-- 引入关于 hystrix Dashboard的依赖 --> <dependency> <groupId>org.springframewor ...

  7. C#集合类:动态数组、队列、栈、哈希表、字典(转)

    1.动态数组:ArrayList 主要方法:Add.AddRange.RemoveAt.Remove 2.队列:Queue 主要方法:Enqueue入队列.Dequeue出队列.Peek返回Queue ...

  8. Javascript 中的 apply与call详解

    一.方法定义 1.call 方法 语法:call(thisObj,arg1, arg2, argN) 参数 thisObj 可选项.将被用作当前对象的对象. arg1, arg2, , argN 可选 ...

  9. 51nod 1432 独木舟【贪心】

    1432 独木舟 基准时间限制:1 秒 空间限制:131072 KB 分值: 10 难度:2级算法题  收藏  关注 n个人,已知每个人体重.独木舟承重固定,每只独木舟最多坐两个人,可以坐一个人或者两 ...

  10. ACdream1032(树形DP)

    ACdream1032 题意 给出一棵树,每个节点有权值,问由 \(1\) ~ \(n\) 个节点组成的树块的权值和的最小值. 分析 首先发现 \(n\) 很小,那么我们可以开一个二维数组 \(dp[ ...