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 ...
随机推荐
- React后端管理系统-商品详情detail组件
import React from 'react'; import MUtil from 'util/mm.jsx' import Product from 'service/product-serv ...
- WEB相关背景知识(新手)
1.评估域名类型 .com——商业实体 .edu——仅限有学位或更高等学历授予资格的高等教育使用 .gov——仅限政府使用 .net——与Internrt网络支持相关的团体,通常是Internet服务 ...
- Javascript入门笔记1-script标签
1.script标签在HTML文件中添加JavaScript代码. JavaScript代码只能写在HTML文件中吗?当然不是,我们可以把HTML文件和JS代码分开,并单独创建一个JavaScript ...
- 开发常用宏 - iOS
以下是一些开发中会经常用到的宏,简单的进行了整理,为了今后可以更加方便的使用,从而提升开发的效率,不为此搭进去更多时间. 也希望有大家可以补充,从而使其更加强加! /** * 开发常用宏相关 */ # ...
- HDU.2561 第二小整数(water)
题目来源:2561 题意分析:找出一堆数中第二小的整数,和题目说的一样 我的思路:冒泡或者sort()一下就ok了,但是我因为没看到多个测试用例还是吃了几记WA . ┭┮﹏┭┮ 完整代码: #incl ...
- win7同时安装python2和python3
1.下载python2和python3版本. 2.安装python3 1>选择添加PATH路径到系统. 2>为所有用户安装python. 3.安装python2 1>为所 ...
- 10.1.2 Document类型【JavaScript高级程序设计第三版】
JavaScript 通过Document 类型表示文档.在浏览器中,document 对象是HTMLDocument(继承自Document 类型)的一个实例,表示整个HTML 页面.而且,docu ...
- Linux系统完整安装在虚拟机Mini
打开VMware Workstation虚拟机,然后如下图一步到位: 此处只是简单的安装Linux系统,要想查看安装后的IP等配置看: https://www.cnblogs.com/gentle-a ...
- 学习python第十一天,函数3 函数的序列化和反序列化
我们把变量从内存中变成可存储或传输的过程称之为序列化,序列化之后,就可以把序列化后的内容写入磁盘,或者通过网络传输到别的机器上. 反过来,把变量内容从序列化的对象重新读到内存里称之为反序列化,即unp ...
- 线程、进程、协程和GIL(一)
参考链接:https://www.cnblogs.com/alex3714/articles/5230609.html https://www.cnblogs.com/work115/p/562027 ...