数学 ACdream 1196 KIDx's Triangle
/*
这道题花了好长时间AC,思路有,但是表达式少写了括号一直乱码,囧!
注意:a==0时要特判:)
*/
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <string>
#include <cmath>
using namespace std; const int MAXN = 1e4 + ;
const int INF = 0x3f3f3f3f;
const double PI = acos (-1.0); double f(double k)
{
return 1.0 * k * PI / ;
} int main(void) //ACdream 1196 KIDx's Triangle
{
//freopen ("H.in", "r", stdin); double a, b, c, d;
double ae, cd, ce, de, ab, ad, be, bd;
double x;
while (scanf ("%lf%lf%lf%lf", &a, &b, &c, &d) == )
{
if (a == )
{
puts ("0.00"); continue;
} ad = sin (f(c)) / sin (f(a+b+c));
ae = sin (f(c+d)) / sin (f(b+c+d));
be = sin (f(b)) / sin (f(b+c+d));
bd = sin (f(a+b)) / sin (f(a+b+c));
de = sqrt (be*be + bd*bd - * be * bd * cos (f(d))); x = acos ((de*de+ae*ae-ad*ad) / (2.0 * de * ae)) * / PI; if (x < ) printf ("%.2f\n", 180.0 - x);
else printf ("%.2f\n", x);
} return ;
}
数学 ACdream 1196 KIDx's Triangle的更多相关文章
- 模拟 ACdream 1196 KIDx's Pagination
题目传送门 /* 简单模拟:考虑边界的情况输出的是不一样的,还有思维好,代码能短很多 */ #include <cstdio> #include <iostream> #inc ...
- acdream.18.KIDx's Triangle(数学推导)
KIDx's Triangle Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others) Sub ...
- acdream.A Very Easy Triangle Counting Game(数学推导)
A - A Very Easy Triangle Counting Game Time Limit:1000MS Memory Limit:64000KB 64bit IO Forma ...
- 周赛-KIDx's Pagination 分类: 比赛 2015-08-02 08:23 7人阅读 评论(0) 收藏
KIDx's Pagination Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others) S ...
- ACdream区域赛指导赛之专题赛系列(1)の数学专场
Contest : ACdream区域赛指导赛之专题赛系列(1)の数学专场 A:EOF女神的相反数 题意:n(<=10^18)的数转化成2进制.翻转后(去掉前导零)输出十进制 思路:water ...
- HDU 5914 Triangle 数学找规律
Triangle 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5914 Description Mr. Frog has n sticks, who ...
- acdream.LCM Challenge(数学推导)
LCM Challenge Time Limit:1000MS Memory Limit:64000KB 64bit IO Format:%lld & %llu Submit ...
- acdream.Triangles(数学推导)
Triangles Time Limit:1000MS Memory Limit:64000KB 64bit IO Format:%lld & %llu Submit Stat ...
- acdream.Bet(数学推导)
Bet Time Limit:1000MS Memory Limit:64000KB 64bit IO Format:%lld & %llu Submit Status Pra ...
随机推荐
- 汉诺塔问题II(模拟)
汉诺塔问题II Time Limit: 1 Sec Memory Limit: 64 MB Submit: 1556 Solved: 720 Description 汉诺塔(又称河内塔)问题是源于 ...
- Largest Rectangle in a Histogram
2107: Largest Rectangle in a Histogram Time Limit: 1 Sec Memory Limit: 64 MBSubmit: 777 Solved: 22 ...
- 删除右键ATI CATALYST(R) Control Center的方法
http://share.weiyun.com/c47530d3e44ea15b606d4ba6f1b00a28
- 【leetcode】Subsets
Subsets Given a set of distinct integers, S, return all possible subsets. Note: Elements in a subset ...
- 【UGUI】Canvas和Rect Transform
Canvas 1.所有的UI元件都需要放在Canvas里 2.UI元件的绘制顺序,与在 Hierarchy的顺序相同,在上面的元素会先被绘制,位于后续绘制元素的下面 3.可以选择3种不同的渲染模式: ...
- 手动构建Servlet项目的流程
前面讨论过手动建立jsp的项目,jsp是tomcat服务器负责编译执行,所以配置相对简单,而Servlet需要先把java源文件编译成字节码class文件,然后再执行,所以需要servlet-api. ...
- 22.python笔记之web框架
一.web框架本质 1.基于socket,自己处理请求 #!/usr/bin/env python3 #coding:utf8 import socket def handle_request(cli ...
- DP:Sumsets(POJ 2229)
数的集合问题 题目大意:给定你一个整数m,你只能用2的k次幂来组合这个数,问你有多少种组合方式? 这一题一看,天啦太简单了,完全背包?是不是? 不过的确这一题可以用完全背包来想,但是交题绝对是TLE ...
- ios xcode Could not load the "MyImage.png" image referenced from a nib in the bundle with identifier "com.mytest.MyProject"
出现找不到xib指定的图片,需要指定图片的完整路径,不能只是图片名 详见:http://vocaro.com/trevor/blog/2012/10/21/xcode-groups-vs-folder ...
- Android之ExpandableListView
ExpandableListView可以用来表现多层级的listView,本文主要是ExpandableListView的一个简单实现 布局文件 <LinearLayout xmlns:andr ...