数学 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 ...
随机推荐
- dedecms文章标题是在哪个数据库表?要批量替换关键词
一位小MM刚接触dedecms没多久还不熟悉后台的操作,她说改dedecms文章中的品牌名改到手酸,问ytkah是否有批量替换关键词的方法,教了她dedecms后台批量替换文章中的关键词方法,她高兴坏 ...
- virgo虚拟桌面
转载: http://www.appinn.com/virgo-virtual-desktop-for-windows/ virgo 是一款 Windows 下的极简虚拟桌面,源程序自身只有 7KB, ...
- 默认hosts后面为files dns
售后工程师 : 您好,问题已经解决,问题原因是您修改了/etc/nsswitch.conf配置文件中的hosts:这项导致的,默认hosts后面为files dns,但是后面去掉了DNS导致直接使用本 ...
- mysql中binary相加的问题
我在mysql中有这样一段代码 SQL code ? 1 2 3 4 5 6 7 8 declare @byte1 binary(1) declare @byte2 binary(1) decla ...
- Android clickable 和 focusable
setClickable(),好像是控制按钮是否可以被点击和点击之后触发监听器事件.setFocusable();控制键盘是否可以获得这个按钮的焦点.(我按实体键盘上方向键,button被选中) 今天 ...
- WPF 打印控件 无弹框打印。
WPF中打印用到了 PrintDialog类. 其中设置打印属性的是PrintTicket,管理打印机的是PrintQueue. 实例如下: public class PrintDialogHelpe ...
- 【JAVA、C++】LeetCode 007 Reverse Integer
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 解题思路:将数字 ...
- java代码获取jdbc链接properties
public static String getDirPath() { Resource resource = null; Properties props = null; String driver ...
- vs c++中读取数据流并存储
ifstream in("test.txt"); vector<string> vs; string s; while(!in.eof()) { in>>s ...
- 【Python爬虫】入门知识
爬虫基本知识 这阵子需要用爬虫做点事情,于是系统的学习了一下python爬虫,觉得还挺有意思的,比我想象中的能干更多的事情,这里记录下学习的经历. 网上有关爬虫的资料特别多,写的都挺复杂的,我这里不打 ...