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 <c…
NN is an experienced internet user and that means he spends a lot of time on the social media. Once he found the following image on the Net, which asked him to compare the sizes of inner circles: It turned out that the circles are equal. NN was very…
推公式,水题.cos()函数是默认弧度制的 #include <iostream> #include <cstring> #include <string> #include <map> #include <set> #include <algorithm> #include <fstream> #include <cstdio> #include <cmath> #include <stac…
题目链接:https://vjudge.net/problem/CodeForces-1100C 题意: 题目给出外部圆的数目n和内部圆的半径r,要求求出外部圆的半径以满足图片要求. 显然这是一道数学题,需要通过分析图形构成解出待求半径. 分析: 从图中可以看出,∆OoD为一个直角三角形, ,容易得到关系: 解得R的值为: 代码如下: #include <iostream> #include <cstring> #include <cstdio> #include &l…
题目链接: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 he found the following image on the Net, which asked him to compare the sizes of inner circles: It turned out th…
链接: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…
链接:https://codeforces.com/contest/1100 A - Roman and Browser - [暴力枚举] 题意:浏览器有 $n$ 个网页,编号 $1 \sim n$,选择一个整数 $b$,则关掉所有编号为 $b + i \cdot k$ 的网页,其中 $k$ 为给定的整数,$i$ 为任意整数.然后,留下的网页有两种类型,计算两种类型的网页数目差,要求你给出这个差最大可以是多少. 题解:$n$ 的范围很小,可以直接纯暴力做即可. AC代码: #include<bi…
以后不放水题了 C.NN and the Optical Illusion 复习一下高中数学即可 $\frac{ans}{ans+r}=\sin \frac{\pi}{n}$ 解方程 #include<cmath> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; ); int n,d; double a; int main() { scanf("…
A. Roman and Browser 签到. #include <bits/stdc++.h> using namespace std; ]; int get(int b) { ]; memset(vis, , sizeof vis); int c = b; while (c <= n) { vis[c] = ; c += k; } c = b - k; ) { vis[c] = ; c -= k; } , r = ; ; i <= n; ++i) if (!vis[i]) {…
Codeforces Round #532 (Div. 2) 题目总链接:https://codeforces.com/contest/1100 A. Roman and Browser 题意: 给出由-1和1组成的n个数,现在任意选定一个起点,从起点开始向左向右k个k个地拿走.最后问abs(cnt(-1)-cnt(1))最大是多少. 题解: 由于n和k最多只有100,所以枚举起点直接暴力就好了. 代码如下: #include <bits/stdc++.h> using namespace s…