New Year Table(几何)
Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u
Description
Gerald is setting the New Year table. The table has the form of a circle; its radius equals R. Gerald invited many guests and is concerned whether the table has enough space for plates for all those guests. Consider all plates to be round and have the same radii that equal r. Each plate must be completely inside the table and must touch the edge of the table. Of course, the plates must not intersect, but they can touch each other. Help Gerald determine whether the table is large enough for n plates.
Input
The first line contains three integers n, R and r (1 ≤ n ≤ 100, 1 ≤ r, R ≤ 1000) — the number of plates, the radius of the table and the plates' radius.
Output
Print "YES" (without the quotes) if it is possible to place n plates on the table by the rules given above. If it is impossible, print "NO".
Remember, that each plate must touch the edge of the table.
Sample Input
4 10 4
YES
5 10 4
NO
1 10 10
YES
Hint
The possible arrangement of the plates for the first sample is
题解:小圆贴着大圆的边,问是否能放n个;注意精度;
代码:
#include<iostream>
#include<cstdio>
#include<cmath>
#in\
clude<algorithm>
using namespace std;
const double PI = acos(-1.0);
int main(){
int n, R, r;
while(~scanf("%d%d%d", &n, &R, &r)){
if(r > R){
if(n == )
puts("YES");
else
puts("NO");
continue;
}
else if(r == R){
if(n <= )
puts("YES");
else
puts("NO");
continue;
} else if( * r > R){
if(n <= )
puts("YES");
else
puts("NO");
continue;
}
double cosa = (2.0 * (R - r) * (R - r) - (2.0*r) * (2.0*r))/ (2.0*(R-r)*(R-r));
double a = acos(cosa);
//printf("%lf\n", 2.0 * PI / a);
if((n - 2.0 * PI / a) <= 1e-){
puts("YES");
}
else{
puts("NO");
}
}
}
New Year Table(几何)的更多相关文章
- CodeForces - 140A New Year Table (几何题)当时没想出来-----补题
A. New Year Table time limit per test2 seconds memory limit per test256 megabytes inputstandard inpu ...
- DOM 元素节点几何量与滚动几何量
当在 Web 浏览器中查看 HTML 文档时,DOM 节点被解析,并被渲染成盒模型(如下图),有时我们需要知道一些信息,比如盒模型的大小,盒模型在浏览器中的位置等等,本文我们就来详细了解下元素节点的几 ...
- Arcgis 几何网络分析
ArcGIS:网络分析(转) 由于之前对网络分析的理解有很多问题,所以在网上找了一些资料,这是其中一篇我觉得比较好的,所以就整理了一下,发到网上来,留个底吧,呵呵 注:关于几何网络的建立见前面的& ...
- ACM: CodeForces 140A New Year Table-数学几何
CodeForces 140A New Year Table Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d ...
- [ACM_几何] UVA 11300 Spreading the Wealth [分金币 左右给 最终相等 方程组 中位数]
Problem A Communist regime is trying to redistribute wealth in a village. They have have decided to ...
- postgis几何操作函数集
管理操作函数 AddGeometryColumn - Adds a geometry column to an existing table of attributes. By default use ...
- DHT(Distributed Hash Table,分布式哈希表)
DHT(Distributed Hash Table,分布式哈希表)类似Tracker的根据种子特征码返回种子信息的网络. DHT全称叫分布式哈希表(Distributed Hash Table),是 ...
- Jack Straws POJ - 1127 (几何计算)
Jack Straws Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 5428 Accepted: 2461 Descr ...
- OGC定义的几何要素
OGC定义了两种描述几何对象的格式,分别是WKB(Well-Known Binary)和WKT(Well-Known Text). 在SQL语句中,用以下的方式可以使用WKT格式定义几何对象:几何类型 ...
随机推荐
- RMAN常用备份恢复命令汇总
RMAN命令 1.独立命令 RMAN>shutdown immediate RMAN>startup RMAN>backup format 'd:\backup\%d_%s.b ...
- oracle的启动和关闭
一.sql*plus方式: 用sql*plus来连接到Oracle Sqlplus /nolog 是以不连接数据库的方式启动sql*plus Connect /as sysdba 是以DBA ...
- compass模块----Helpers
Color Stops:在使用CSS3渐变属性生成图片的时候,有时候为了打造更丰富的渐变效果除了声明渐变线上的起始点和终止点的色值,还有声明一些中间点的色值,这些点我们就称之为Color Stops. ...
- asp.net事件委托易理解实例
比如说一个公司(场景),你是老板,手下有两个员工,小张和小王. 你命令小王,如果小张玩游戏,则小王扣去小张500元钱.这就是现实中的委托.实际上,在写程序中,程序员就是老板,小张和小王就是两个对象.小 ...
- EF数据存贮问题二之“无法定义这两个对象之间的关系,因为它们附加到不同的 ObjectContext 对象”
“无法定义这两个对象之间的关系,因为它们附加到不同的 ObjectContext 对象”,这是在EF中,一对多关系表,有外键的类保存至数据库中出现的错误. 我原来是用JAVA开发的,习惯性的处理一对多 ...
- Geodatabase - 判断是否处于编辑状态
Engine中提供IDatasetEdit来判断数据是否处于编辑状态,我们知道,在ArcMap中,进行编辑的不一定都是要素类,也可以是表,网络几何等.以下能在ArcMap中进行编辑的数据都实现了 ID ...
- "客户端无法连接到远程计算机"错误的解决方法
问题: 客户端无法连接到远程计算机. 可能没有启用远程连接或者计算机太忙不能接受新的连接. 也可能是网络问题阻止连接.请稍后重新尝试连接. 如果问题仍然存在 请与管理员联系. 解决方法: 1.首先确认 ...
- 原创:2016.4.25-2016.5.1 C# informal essay and tittle_tattle
1.Some tips of the Time in C sharp (1) How to define the category of the "Datetime"? date ...
- 选中CheckBoxList的值放到TextBox中,再次选中从textBox中删除
当选中checkboxlist中的值,直接放到文本框中,在checkboxlist的SelectedIndexChanged事件下执行方法, //将选中的值放到文本框中 ...
- 愉快的开始 - Windows程序设计(SDK)000
愉快的开始 让编程改变世界 Change the world by program 参考教材 购买链接:Windows程序设计(第5版)(珍藏版)(附CD-ROM光盘1张) 学习环境 视频演示:W ...