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 ...
随机推荐
- BIO与NIO
BIO与NIO 1.传统BIO (1)特点 面向数据流 阻塞式传输 一个客户端对应一个线程 在客户机增多的情况下,线程资源随之增多,会造成cpu资源枯竭 (2)需求 客户机向服务器输出字符串,逐一 ...
- 网页弹出[Object HTMLDivElement],怎么取值?
使用innerHTML方法,可以得到文本值
- 6-1 md5加密
1.导入hashlib模块,使用它的md5方法进行加密 import hashlib # import md5 python2 s = 'admin123' # .将字符串类型转换成byte类型才能加 ...
- thinkphp5,单图,多图,上传
/** * 上传单图 */ function upload($path, $filename) { $file = request()->file($filename); $info = $fi ...
- Python中的文件和目录操作实现
Python中的文件和目录操作实现 对于文件和目录的处理,虽然可以通过操作系统命令来完成,但是Python语言为了便于开发人员以编程的方式处理相关工作,提供了许多处理文件和目录的内置函数.重要的是,这 ...
- JS常用数组方法及实例
1.join(separator):将数组的元素组起一个字符串,以separator为分隔符 ,,,,]; var b = a.join("|"); //如果不用分隔符,默认逗号隔 ...
- SpringCloud框架搭建+实际例子+讲解+系列五
(4)服务消费者,面向前端或者用户的服务 本模块涉及到很多知识点:比如Swagger的应用,SpringCloud断路器的使用,服务API的检查.token的校验,feign消费者的使用.大致代码框架 ...
- linux最大进程数
使用 ulimit -a 命令,查看 max user processes 的输出,就是系统最大进程数 core file size (blocks, -c) unlimited data seg s ...
- POJ:1703-Find them, Catch them(并查集好题)(种类并查集)
Find them, Catch them Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 49867 Accepted: 153 ...
- 9,Flask 中的蓝图(BluePrint)
蓝图,听起来就是一个很宏伟的东西,在Flask中的蓝图 blueprint 也是非常宏伟的,它的作用就是将 功能 与 主服务 分开. 比如说,你有一个客户管理系统,最开始的时候,只有一个查看客户列表的 ...