链接:https://codeforces.com/contest/1100/problem/C

题意:

一个圆球外面由其他圆球包裹,两两相连。

给出n,r。

n为外面圆球数量,r为内部圆球半径。

求外面圆半径R。

思路:

将内圆和外面两个相邻圆圆心连线,成三角形,将内圆圆心与内圆与外圆交点连线。

可得出公式。

代码:

#include <bits/stdc++.h>
#define PI 3.1415926535
using namespace std; int main()
{
int n;
double r;
cin >> n >> r;
double len = 2.0*(r * sin((360.0/(2*n))/180.0 * PI));
double R = (len*r)/(2*r-len);
printf("%.7f",R); return 0;
}

  

Codeforces Round #532(Div. 2) C.NN and the Optical IIIusion的更多相关文章

  1. Codeforces Round #532 (Div. 2) 题解

    Codeforces Round #532 (Div. 2) 题目总链接:https://codeforces.com/contest/1100 A. Roman and Browser 题意: 给出 ...

  2. Codeforces Round #532 (Div. 2)

    Codeforces Round #532 (Div. 2) A - Roman and Browser #include<bits/stdc++.h> #include<iostr ...

  3. Codeforces Round #532 (Div. 2) Solution

    A. Roman and Browser 签到. #include <bits/stdc++.h> using namespace std; ]; int get(int b) { ]; ...

  4. Codeforces Round #532 (Div. 2)- B(思维)

    Arkady coordinates rounds on some not really famous competitive programming platform. Each round fea ...

  5. Codeforces Round #532 (Div. 2) F 线性基(新坑) + 贪心 + 离线处理

    https://codeforces.com/contest/1100/problem/F 题意 一个有n个数组c[],q次询问,每次询问一个区间的子集最大异或和 题解 单问区间子集最大异或和,线性基 ...

  6. Codeforces Round #532 (Div. 2):F. Ivan and Burgers(贪心+异或基)

    F. Ivan and Burgers 题目链接:https://codeforces.com/contest/1100/problem/F 题意: 给出n个数,然后有多个询问,每次回答询问所给出的区 ...

  7. Codeforces Round #532 (Div. 2)- C(公式计算)

    NN is an experienced internet user and that means he spends a lot of time on the social media. Once ...

  8. Codeforces Round #532 (Div. 2)- A(思维)

    This morning, Roman woke up and opened the browser with nn opened tabs numbered from 11 to nn. There ...

  9. Codeforces Round #532(Div. 2) B.Build a Contest

    链接:https://codeforces.com/contest/1100/problem/B 题意: 给n,m. 给m个数,每个数代表一个等级,没给一个将其添加到题目池中,当题目池中有难度(1-n ...

随机推荐

  1. (转)C++ STL set() 集合

    set是STL中一种标准关联容器(vector,list,string,deque都是序列容器,而set,multiset,map,multimap是标准关联容器),它底层使用平衡的搜索树——红黑树实 ...

  2. BZOJ1086 王室联邦 —— 树分块

    题目链接:https://vjudge.net/problem/HYSBZ-1086 1086: [SCOI2005]王室联邦 Time Limit: 10 Sec  Memory Limit: 16 ...

  3. Program received signal SIGSEGV, Segmentation fault.

    GDB调试的时候出现了: Program received signal SIGSEGV, Segmentation fault.(程序收到信号SIGSEGV,分段故障) SIGSEGV:在POSIX ...

  4. the art of seo(chapter five)

    Keyword Research ***The Theory Behind Keyword Research***1.When users go to search engines and type ...

  5. nginx开发_ngx_http_script源码解析

    功能简介 nginx中有很多配置项支持以变量的形式存在,在运行时根据实时值进行处理.例如如下配置: location / { sub_filter '<a href="http://1 ...

  6. MVC中为自动生成实体类添加验证

    将额外的基于特性的元数据(象验证特性)施加到由VS设计器自动生成/维护的类的一个方法是,采用一个我们称之为“伙伴类(buddy classes)”的技术. 基本上来说,你创建另外一个类,包含你的验证特 ...

  7. KVM虚拟机内无agent情况下的监控方法

    KVM虚拟机内无agent情况下的监控(ceilometer实现) 今天看到大家在群里讨论KVM虚拟机的监控问题,而且是要求VM内无agent情况下的监控.这方面确实没有深入研究,但尚有些openst ...

  8. git 系统中 post-receive 钩子不能正常执行 git pull 解决方法

    有一个需求是本地git在push到远程 git repo 之后,在远程服务器上自动在/dir/foo下执行 git pull 的操作.想来是一个很简单的需求,不就是在远程的 foo.git 仓库中的 ...

  9. Kefa and Watch

    题意: 维护一个长度为n的字符串,两种操作: 1.将 [l,r] 的字符变为 c 2.询问 d 是否为 $S(l,r)$ 的周期 解法: 首先分析如何令 [l,r] 的周期为d,利用循环串的性质得: ...

  10. checkbox的几种遍历方法

    html代码如下: <div> <input type="checkbox" name="ckb" value="1" / ...