Hard problem

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 192    Accepted Submission(s): 145

Problem Description
cjj is fun with math problem. One day he found a Olympic Mathematics problem for primary school students. It is too difficult for cjj. Can you solve it?

Give you the side length of the square L, you need to calculate the shaded area in the picture.

The full circle is the inscribed circle of the square, and the center of two quarter circle is the vertex of square, and its radius is the length of the square.

 
Input
The first line contains a integer T(1<=T<=10000), means the number of the test case. Each case contains one line with integer l(1<=l<=10000).
 
Output
For each test case, print one line, the shade area in the picture. The answer is round to two digit.
 
Sample Input
1
1
 
Sample Output
0.29
 
Author
BUPT
 
Source
 
 
 
解析:
 
 
 
#include <cstdio>
#include <cmath> int main()
{
int t;
scanf("%d", &t);
int l;
while(t--){
scanf("%d", &l);
double res = 4*l*l*(1.0/8*asin(sqrt(7.0/8))-0.5*acos(5.0/8*sqrt(2))+sqrt(7)/16);
printf("%.2f\n", res);
}
return 0;
}

  

  

HDU 5858 Hard problem的更多相关文章

  1. HDU 5858 Hard problem (数学推导)

    Hard problem 题目链接: http://acm.split.hdu.edu.cn/showproblem.php?pid=5858 Description cjj is fun with ...

  2. HDU 5858 Hard problem ——(计算几何)

    其实这题最多是个小学奥数题- -,,看到别人博客各显神通,也有用微积分做的(我也试了一下,结果到最后不会积...). 思路如下(这两张图是网上找来的): 然后就很简单了,算三角形面积可以用海伦公式,也 ...

  3. HDU 3549 Flow Problem(最大流)

    HDU 3549 Flow Problem(最大流) Time Limit: 5000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/ ...

  4. hdu 5106 Bits Problem(数位dp)

    题目链接:hdu 5106 Bits Problem 题目大意:给定n和r,要求算出[0,r)之间全部n-onebit数的和. 解题思路:数位dp,一个ct表示个数,dp表示和,然后就剩下普通的数位d ...

  5. HDU 3374 String Problem (KMP+最大最小表示)

    HDU 3374 String Problem (KMP+最大最小表示) String Problem Time Limit: 2000/1000 MS (Java/Others)    Memory ...

  6. hdu 5105 Math Problem(数学)

    pid=5105" target="_blank" style="">题目链接:hdu 5105 Math Problem 题目大意:给定a.b ...

  7. Hdu 5445 Food Problem (2015长春网络赛 ACM/ICPC Asia Regional Changchun Online)

    题目链接: Hdu  5445 Food Problem 题目描述: 有n种甜点,每种都有三个属性(能量,空间,数目),有m辆卡车,每种都有是三个属性(空间,花费,数目).问至少运输p能量的甜点,花费 ...

  8. 网络流 HDU 3549 Flow Problem

    网络流 HDU 3549 Flow Problem 题目:pid=3549">http://acm.hdu.edu.cn/showproblem.php?pid=3549 用增广路算法 ...

  9. 【HDU 5858】Hard problem

    边长是L的正方形,然后两个半径为L的圆弧和中间半径为L的圆相交.求阴影部分面积. 以中间圆心为原点,对角线为xy轴建立直角坐标系. 然后可以联立方程解出交点. 交点是$(\frac{\sqrt{7} ...

随机推荐

  1. C# 常用的工具类

    编码解码.图片与byte[].日志文件写入和读取 /// <summary> /// 将字符串编码为Base64字符串 /// </summary> /// <param ...

  2. [shell编程]一个简单的脚本

    首先,为什么要学习shell呢?哈哈,当然不是shell能够怎样怎样然后100字. 最近看到一篇博文<开阔自己的视野,勇敢的接触新知识>,读完反思良久.常常感慨自己所会不多,对新知识又有畏 ...

  3. [转]Win7下Eclipse中文字体太小

    最近新装了Win7,打开eclipse3.7中文字体很小,简直难以辨认.在网上搜索发现这是由于Eclipse 3.7 用的字体是 Consolas,显示中文的时候默认太小了.   解决方式有两种:一. ...

  4. 2016年2月---Javascript

    How to Learn JavaScript Properly 如何正确学习JavaScript Learn Intermediate and Advanced JavaScript 书籍: < ...

  5. lintcode:四个数之和

    题目 四数之和 给一个包含n个数的整数数组S,在S中找到所有使得和为给定整数target的四元组(a, b, c, d). 样例 例如,对于给定的整数数组S=. 满足要求的四元组集合为: (-1, 0 ...

  6. SaaS系列介绍之十三: SaaS系统体系架构

    1 系统体系架构设计 软件开发中系统体系架构决定了一个系统稳定性.健壮性.可扩展性.兼容性和可用性,它是系统的灵魂.体系架构是架构师所关注的核心.良好的体系架构是系统成功的开端,否则,再好的代码与设计 ...

  7. SpingMVC中利用BindingResult将错误信息返回到页面中

    SpingMVC中利用BindingResult将错误信息返回到页面中. ActionFrom中: private String name; private String password; get( ...

  8. spring autoWire注解和@resource注解区别

    1.autoWire注解主要是按类型匹配.因为autowire的扫描机制,是按照接口类型来扫描bean的. 而JSR250 @resource注解是通过名称扫描注入的. @autowire注解的扫描方 ...

  9. css元素z-index设置为什么不起作用?

    元素位置重叠的背景常识 (x)html文档中的元素默认处于普通流(normal flow)中,也就是说其顺序由元素在文档中的先后位置决定,此时一般不会产生重叠(但指定负边距可能产生重叠). 当我们用c ...

  10. 2014--9=17 软工二班 MyEclipse blue==3

    package cn.rwkj.test; import java.io.IOException; import java.io.InputStream; import java.net.Server ...