C. NN and the Optical Illusion(几何)
题目链接:http://codeforces.com/contest/1100/problem/C
题目大意:给你n和r,n指的是有n个圆围在里面的圆的外面,r指的是里面的圆的半径,然后让你求外面的圆的半径。
具体思路:,我们就可以列出等式,sin(2*pi/(2*n))=R/(R+r).
然后就直接解等式就可以了。
AC代码:
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
using namespace std;
# define ll long long
# define pi acos(-1.0)
const int maxn = 1e5+;
int main()
{
double n,r;
scanf("%lf %lf",&n,&r);
printf("%.8lf\n",sin(pi/(n))*r/(1.0-sin(pi/(n))));
return ;
}
C. NN and the Optical Illusion(几何)的更多相关文章
- CF 1100C NN and the Optical Illusion(数学)
NN is an experienced internet user and that means he spends a lot of time on the social media. Once ...
- 1100C NN and the Optical Illusion
推公式,水题.cos()函数是默认弧度制的 #include <iostream> #include <cstring> #include <string> #in ...
- CodeForces-1100C NN and the Optical Illusion 简单数学
题目链接:https://vjudge.net/problem/CodeForces-1100C 题意: 题目给出外部圆的数目n和内部圆的半径r,要求求出外部圆的半径以满足图片要求. 显然这是一道数学 ...
- NN and the Optical Illusion-光学幻觉 CodeForce1100C 几何
题目链接:NN and the Optical Illusion 题目原文 NN is an experienced internet user and that means he spends a ...
- Codeforces Round #532(Div. 2) C.NN and the Optical IIIusion
链接:https://codeforces.com/contest/1100/problem/C 题意: 一个圆球外面由其他圆球包裹,两两相连. 给出n,r. n为外面圆球数量,r为内部圆球半径. 求 ...
- Codeforces 1100 - A/B/C/D/E/F - (Undone)
链接:https://codeforces.com/contest/1100 A - Roman and Browser - [暴力枚举] 题意:浏览器有 $n$ 个网页,编号 $1 \sim n$, ...
- Codeforces Round #532
以后不放水题了 C.NN and the Optical Illusion 复习一下高中数学即可 $\frac{ans}{ans+r}=\sin \frac{\pi}{n}$ 解方程 #include ...
- Codeforces Round #532 (Div. 2) Solution
A. Roman and Browser 签到. #include <bits/stdc++.h> using namespace std; ]; int get(int b) { ]; ...
- Codeforces Round #532 (Div. 2) 题解
Codeforces Round #532 (Div. 2) 题目总链接:https://codeforces.com/contest/1100 A. Roman and Browser 题意: 给出 ...
随机推荐
- 从C简单程序的汇编代码入手,以理解计算机工作原理。
贺邦 原创作品转载请注明出处 <Linux内核分析>MOOC课程 http://mooc.study.163.com/course/USTC-1000029000#/info 知识准备 ...
- [转]JAVA 在main中访问内部类、方法等
1.使用静态的属性.方法.内部类 class A { static int i = 1; // A 类的静态属性 static void outPut() // A 类的静态方法 { System.o ...
- jQuery笔记(二)
$()下的常用方法 addClass():添加样式 removeClass():删除样式 $('div').addClass('box2 box4'); $('div').removeClass('b ...
- convert函数语法
convert函数语法: CONVERT(data_type(length), data_to_be_converted, style)data_type(length) 规定目标数据类型(带有可 ...
- es6 对象的扩展
一.现在还有很多浏览器不能直接使用es6语法.特别是手机端的一些低版本的浏览器.都需要用bale转换一下. 但是目前流行的框架中(vue,react,angular).都有自己的脚手架,都能用webp ...
- poi中如何自定义日期格式
1. poi的“Quick Guide”中提供了 “How to create date cells ”例子来说明如何创建日期单元格,代码如下: HSSFCellStyle cellStyle = w ...
- 【Vue学习笔记1】全局配置 Vue.config
1.slient 类型:boolean: 默认:false: 用法:Vue.config.silent = true 用于取消 Vue 所有的日志与警告
- 题解 P2580 【于是他错误的点名开始了】
这个题的题解区就没一简单一点的指针题解?(大概是瞎了) So,这篇题解是给那些想用指针而害怕的同学食用的qwq 记得有一篇题解有个dalao作者放了几个静态模拟的trie树结果最后放了个动态的跑路了. ...
- #LOJ2564 SDOI2018 原题识别 主席树
转载请注明原文地址:http://www.cnblogs.com/LadyLex/p/9057297.html 原题链接: 今天考试考了前天的SDOI考题 天啊我菜爆,只有T2拿了30分 然后考试后半 ...
- [JZOJ 5402] God Knows
终于搞完了这乡里别题目 $ $ 考虑一个 \(dp\) ,设 \(f[i]\) 表示最后一个匹配选 \((i,p[i])\) 的最小费用 首先我们考虑答案长什么样 假设根据 \(p[i]\) 排序 , ...