当前位置: 首页 > news >正文

Codeforces Gym 100733A Shitália 计算几何

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 <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
#include <stack>
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-9
int 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.1415926535898

int main()
{
    double n,R,r;
    cin>>n>>R>>r;
    printf("%.10lf\n",sin(pi/n)*r*R*n);
}

 

相关文章:

  • configure: error: png.h not found.
  • About SOuP
  • js数组如何去重
  • Scala入门指南与建议
  • Java学习之神奇的i=i++
  • How to setup Wicket Examples in Eclipse
  • spring MVC 跳转到另一个controller方法
  • UVA 1661 Equation (后缀表达式,表达式树,模拟,实现)
  • 转帖-Linux下如何同时替换多个文件中的文本或字符串
  • iOS开发之左右抖动效果
  • 学习笔记: JavaScript/JQuery 的cookie操作
  • google hosts
  • grep与正则表达式
  • clearcase 中一些概念和操作
  • 通读Cheerio文档
  • -------------------- 第二讲-------- 第一节------在此给出链表的基本操作
  • 【跃迁之路】【669天】程序员高效学习方法论探索系列(实验阶段426-2018.12.13)...
  • AHK 中 = 和 == 等比较运算符的用法
  • Akka系列(七):Actor持久化之Akka persistence
  • android 一些 utils
  • java B2B2C 源码多租户电子商城系统-Kafka基本使用介绍
  • javascript 总结(常用工具类的封装)
  • mysql innodb 索引使用指南
  • ng6--错误信息小结(持续更新)
  • SpiderData 2019年2月16日 DApp数据排行榜
  • vue数据传递--我有特殊的实现技巧
  • web标准化(下)
  • weex踩坑之旅第一弹 ~ 搭建具有入口文件的weex脚手架
  • 离散点最小(凸)包围边界查找
  • 思否第一天
  • 中国人寿如何基于容器搭建金融PaaS云平台
  • 2017年360最后一道编程题
  • 小白应该如何快速入门阿里云服务器,新手使用ECS的方法 ...
  • #我与Java虚拟机的故事#连载12:一本书带我深入Java领域
  • $Django python中使用redis, django中使用(封装了),redis开启事务(管道)
  • (11)MSP430F5529 定时器B
  • (6)STL算法之转换
  • (C语言)输入自定义个数的整数,打印出最大值和最小值
  • (delphi11最新学习资料) Object Pascal 学习笔记---第8章第5节(封闭类和Final方法)
  • (附源码)spring boot球鞋文化交流论坛 毕业设计 141436
  • (附源码)springboot教学评价 毕业设计 641310
  • (论文阅读30/100)Convolutional Pose Machines
  • (已解决)什么是vue导航守卫
  • (原+转)Ubuntu16.04软件中心闪退及wifi消失
  • (转)程序员技术练级攻略
  • (转载)(官方)UE4--图像编程----着色器开发
  • .bat批处理(七):PC端从手机内复制文件到本地
  • .net core 6 使用注解自动注入实例,无需构造注入 autowrite4net
  • .NET 的静态构造函数是否线程安全?答案是肯定的!
  • .NET 同步与异步 之 原子操作和自旋锁(Interlocked、SpinLock)(九)
  • .NET大文件上传知识整理
  • .NET框架
  • /3GB和/USERVA开关
  • @AutoConfigurationPackage的使用
  • @EnableConfigurationProperties注解使用