hdu 1714 RedField
RedField
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 639 Accepted Submission(s): 213
part is the intersection of an ellipse and a triangle.Now, 8600's not
good at math, so he wants you to help him calculate the area of the
"RedField".
follow.Each test case contains four numbers a, b, x, y(0 < b <= a
<= x),and a is the lenth of OA, b is the lenth of OB,and x, y
representing the coordinate of the point P.
1.00 1.00 2.00 2.00
- #include<iostream>
- #include<cstdio>
- #include<cmath>
- using namespace std;
- int main()
- {
- int n;
- cin>>n;
- while(n--)
- {
- double A,B,k,j_x,j_y,ans;
- double p_x,p_y;
- cin>>A>>B>>p_x>>p_y;
- p_y = p_y>0?p_y:-p_y;
- k=p_y/p_x;
- double tt=(A*A*B*B)/(B*B+A*A*k*k);
- j_x=sqrt(tt);
- j_y=k*j_x;
- double t1=asin(1.0);
- double t2=asin(j_x/A);
- ans=A*B*( ( t1+sin(2*t1)/2.0) -(t2+sin(2*t2)/2.0) )/2+j_x*j_y/2;
- printf("%.2lf\n",ans);
- }
- return 0;
- }
hdu 1714 RedField的更多相关文章
- HDU 1714 math
#include<stdio.h>#include<string.h>#include<iostream>#include<iomanip>#inclu ...
- HDU——PKU题目分类
HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...
- HDU 1710 二叉树的遍历 Binary Tree Traversals
Binary Tree Traversals Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/O ...
- HDU 1708 简单dp问题 Fibonacci String
Fibonacci String Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- HDU 5643 King's Game 打表
King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...
- 转载:hdu 题目分类 (侵删)
转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...
- poj和hdu部分基础算法分类及难度排序
最近想从头开始刷点基础些的题,正好有个网站有关于各大oj的题目分类(http://www.pythontip.com/acm/problemCategory),所以写了点脚本把hdu和poj的一些题目 ...
- hdu 1708 Fibonacci String
Fibonacci String Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Tot ...
- HDOJ 2111. Saving HDU 贪心 结构体排序
Saving HDU Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
随机推荐
- Sass 语法格式及编译
一.sass语法格式 这里说的 Sass 语法是 Sass 的最初语法格式,他是通过 tab 键控制缩进的一种语法规则,而且这种缩进要求非常严格.另外其不带有任何的分号和大括号.常常把这种格式称为 S ...
- 3、SpringBoot+MybatisPlus整合-------代码生成器
<dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</art ...
- linux服务器安装nginx及使用
Nginx在个人的使用之后,感觉非常的方便,所以在这里给出自己安装配置方案.它是一款高性能的 Web和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器.负载均衡是个不错的选择. ...
- SpringBoot学习13:springboot异常处理方式3(使用@ControllerAdvice+@ExceptionHandle注解)
问题:使用@ExceptionHandle注解需要在每一个controller代码里面都添加异常处理,会咋成代码冗余 解决方法:新建一个全局异常处理类,添加@ControllerAdvice注解即可 ...
- hadoop-2.0.0-cdh4.1.2升级到hadoop-2.7.2
升级前准备: 如果是 centos6.x的系统得升级glibc和pam包 在/etc/ld.so.conf 文件里添加 /usr/src/jdk1.6.0_23/jre/lib/amd64/serve ...
- python基础回顾笔记
1.知道了什么是编程语言 2.知道了python.C#.Java都是语言的种类 3.python:有很多种 cpython.pypy.jpython... 4.python的执行方式有两种: 解释器 ...
- 精读《12 个评估 JS 库你需要关心的事》
1 引言 作者给出了从 12 个角度全面分析 JS 库的可用性,分别是: 特性. 稳定性. 性能. 包生态. 社区. 学习曲线. 文档. 工具. 发展历史. 团队. 兼容性. 趋势. 下面总结一下作者 ...
- 如果文件里是汉字的话,这地方seek括号里面只能是偶数
>>> f=open("E:/pythonLearn/140.txt") >>> f.seek(8) #如果文件里是汉字的话,这地方seek括号 ...
- POJ:2385-Apple Catching(dp经典题)
Apple Catching Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14311 Accepted: 7000 Descr ...
- scala高级性质-隐式转换 -02
今天我们来介绍scala的高级特性,上次已经介绍过他的一个特性:高阶函数,这次是隐式转换 1.隐式转换的例子 read的例子 解析:发现这个file没有read的方法,然后就开始在开始在这个上下文里面 ...