博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Codeforces Gym 100733A Shitália 计算几何
阅读量:7077 次
发布时间:2019-06-28

本文共 2243 字,大约阅读时间需要 7 分钟。

Shitália

Time Limit: 20 Sec

Memory Limit: 256 MB

题目连接

http://acm.hust.edu.cn/vjudge/contest/view.action?cid=88994#problem/A

Description

After suddenly becoming a billionaire, Shi adopted YOLO as his motto and decided to buy a small european island, which he named Shitalia. Many people decided to move to Shitalia to run away from the economic crisis, and then created the Shitalian mafia, led by Dom Shi.

The Shitalian economy is based on smuggling spoiled cheese, but, as you can imagine, there aren't many people interested in spoiled cheese. Therefore, Shi decided to earn money with land rental.

Shitalia is a star-shaped island. Shi is very picky, so he chose a Shi-regular n-star. An n-star is Shi-regular if there are n outer points andn inner points alternated. The outer points must lay on a circle with radius R and the inner points must lay on a circle with radius r and all the points must be equally spaced.

Print the area of the Shitalia.

 Shi-regular 6-star and 4-star.

Input

The first line contains three integers 3 ≤ n ≤ 20, 1 ≤ R ≤ 106 and 1 ≤ r ≤ R, indicating the number of points of Shitalia, the radius of the outer circle and the radius of the inner circle.

Output

Print a single real number - the answer to the problem with absolute or relative error of at most 10 - 6.

Sample Input

3 2 1

Sample Output

5.1961524227

HINT

 

题意

给你一个等n角形,然后求面积

题解

数学题,一眼题,求三角形面积就好了……

代码:

//qscqesze#include 
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
typedef long long ll;using namespace std;//freopen("D.in","r",stdin);//freopen("D.out","w",stdout);#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)#define maxn 200051#define mod 10007#define eps 1e-9int Num;//const int inf=0x7fffffff; //нчоч╢Сconst int inf=0x3f3f3f3f;inline ll read(){ ll x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){ if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f;}//**************************************************************************************#define pi 3.1415926535898int main(){ double n,R,r; cin>>n>>R>>r; printf("%.10lf\n",sin(pi/n)*r*R*n);}

 

转载地址:http://gadml.baihongyu.com/

你可能感兴趣的文章
郎意难坚,侬情自热(文/王路)
查看>>
Android SDK Manager 中如果没有相应的镜像ARM XX Image
查看>>
ASP.NET Web API的Controller是如何被创建的?
查看>>
Ant build xml中的各种变量解释
查看>>
labview视频采集IMAdx
查看>>
Android:实现一种浮动选择菜单的效果
查看>>
【转】如何查看linux版本 如何查看LINUX是多少位
查看>>
openwrt-智能路由器hack技术(1)---"DNS劫持"
查看>>
第十二章 数据备份与还原
查看>>
[redis] Redis 配置文件置参数详解
查看>>
Java 多线程程序设计
查看>>
SQL--类型转换
查看>>
VGG_19 train_vali.prototxt file
查看>>
获取文件或是文件夹的大小和占用空间
查看>>
libssh2进行远程运行LINUX命令
查看>>
Android Gson深入分析
查看>>
Android中自动跳转到系统设置界面
查看>>
树后台数据存储(採用webmethod)
查看>>
Android利用Fiddler进行网络数据抓包【怎么跟踪微信请求】
查看>>
memcached系列之二
查看>>