cf--1C
//Accepted 0 KB 60 ms
//给出正多变形上的三个点,求正多形的最小面积
//记三个点之间的距离a,b,c;
//由余弦定理得cosA
//从而可求出sinA,和正多边形所在外接圆的半径r
//设三条边所对的圆心角为:theta1,theta2,theta3
//则正多边形所对的圆心角为gcd(theta1,gcd(theta2,theta3))
//其中gcd(theta1,theta2)为求两个浮点数的最大公约数
//至此我们可以根据正多边形所在外接圆的半径r和圆心角求出正多边形的面积
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <cmath>
#include <algorithm>
using namespace std;
const double Pi=acos(-1.0);
/**
* This is a documentation comment block
* @authr songt
*/
struct Point
{
double x,y;
}p[];
double getDis(Point p1,Point p2)
{
return sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y));
}
double gcd(double a,double b)
{
) return a;
) return b;
return gcd(b,fmod(a,b));
}
void slove()
{
],p[]);
],p[]);
],p[]);
*b*c);
-cosA*cosA);
*sinA);
//printf("r=%lf\n",r);
*asin(a/(*r));
*asin(b//r);
//double thetaC=2*asin(c/2/r);
*Pi-thetaA-thetaB;
//printf("%lf\n",thetaA+thetaB+thetaC);
double theta=gcd(thetaA,gcd(thetaB,thetaC));
//printf("theta=%lf\n",theta);
//printf("Pi=%lf\n",Pi);
*Pi/theta*r*r/*sin(theta);
printf("%.6lf\n",s);
}
int main()
{
].x,&p[].y,&p[].x,&p[].y,&p[].x,&p[].y)!=EOF)
slove();
;
}
cf--1C的更多相关文章
- grep 、find 、tree 新发现
[root@localhost tftpboot]# ip address | grep -A 1 " eno16777736"2: eno16777736: <BROADC ...
- AES advanced encryption standard 3
This optimized <../aesbench/> AES implementation conforms to FIPS-. aes.h #ifndef _AES_H #defi ...
- AES加密的C语言实现
摘自网上一种AES加密,用C语言实现通过32字节密钥对16字节长度数据进行加密. #include <string.h> #include <stdio.h> #ifndef ...
- CF#190DIV.1
/* CF#190DIV.1-C 题意:给你n个结点的树,给这些结点标记字母AB..Z,对于标记相同的结点路径上 的结点的标记必须有一个是大于该标记的:问是否可以标记(A是最大标记) 分析:整天思路就 ...
- ORA-00494: enqueue [CF] held for too long (more than 900 seconds) by 'inst 1, osid 5166'
凌晨收到同事电话,反馈应用程序访问Oracle数据库时报错,当时现场现象确认: 1. 应用程序访问不了数据库,使用SQL Developer测试发现访问不了数据库.报ORA-12570 TNS:pac ...
- cf之路,1,Codeforces Round #345 (Div. 2)
cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅..... ...
- cf Round 613
A.Peter and Snow Blower(计算几何) 给定一个点和一个多边形,求出这个多边形绕这个点旋转一圈后形成的面积.保证这个点不在多边形内. 画个图能明白 这个图形是一个圆环,那么就是这个 ...
- ARC下OC对象和CF对象之间的桥接(bridge)
在开发iOS应用程序时我们有时会用到Core Foundation对象简称CF,例如Core Graphics.Core Text,并且我们可能需要将CF对象和OC对象进行互相转化,我们知道,ARC环 ...
- [Recommendation System] 推荐系统之协同过滤(CF)算法详解和实现
1 集体智慧和协同过滤 1.1 什么是集体智慧(社会计算)? 集体智慧 (Collective Intelligence) 并不是 Web2.0 时代特有的,只是在 Web2.0 时代,大家在 Web ...
- CF memsql Start[c]UP 2.0 A
CF memsql Start[c]UP 2.0 A A. Golden System time limit per test 1 second memory limit per test 256 m ...
随机推荐
- JSP action elements - JavaBean
语法 描述 jsp:include 在页面被请求的时候引入一个文件. jsp:useBean 寻找或者实例化一个JavaBean. jsp:setProperty 设置JavaBean的属性. jsp ...
- LaTeX内容总结
欢迎关注我的社交账号: 邮箱: jiangxinnju@163.com 博客园地址: http://www.cnblogs.com/jiangxinnju GitHub地址: https://gith ...
- png-24在ie6中的几种透明方法
转载 http://www.cnblogs.com/jikey/archive/2013/03/13/2957168.html 由于游戏类官网在页面背景和装饰人物的设计上追求画丽且与游戏风格想匹配,这 ...
- uva 1639--精度处理方法之取对数(uva 1639)
1639 - Candy Time limit: 3.000 seconds 1639 CandyLazyChild is a lazy child who likes candy very much ...
- c# 中的委托以及匿名方法lambda
1.委托的定义internal delegate int MyAddFunDe(int a,int b)2.匿名方法1)MyAddFunDe fun = delegate(int a,int b){ ...
- Objective-C(面向对象的三大特性)
封装 set方法 作用:提供一个方法给外界设置成员变量值,可以在方法里面进行过滤 命名规范 1. 方法名必须以set开头 2. set后面跟上成员变量的名称,成员变量的首字母必须大写 3. 返回值一定 ...
- Android Bundle、Handler和Message类介绍
Bundle是一个载体,可以存放基本数据类型.对象等内容,相当于一辆汽车,可以装载很多东西,然后运到需要的地方,例如: Bundle mBundle=new Bundle(); mBundle.put ...
- Windows 8 App: Information about CloudsCool Helper application
Website:http://www.cloudscool.com: App download address:http://dwz.cn/7DOJm: App English introduct ...
- Introduction to Windows 8: The Definitive Guide for Developer
<Windows 8应用开发权威指南>介绍 Introduction to Windows 8: The Definitive Guide for Developer 一.封面设计要求及文 ...
- cisco VPN
配置实例:公司在北京而分公司在上海,如果租用光纤业务费用会比较高,另外安全性也没有保证,特别是对内网的访问方面.我们要在总公司和分公司之间建立有效的VPN连接.具体网络拓扑如图1所示.北京路由器名为R ...