Hard problem

题目链接:

http://acm.split.hdu.edu.cn/showproblem.php?pid=5858

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?
![](http://images2015.cnblogs.com/blog/764119/201608/764119-20160818172426750-377270246.png)
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

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

Source


2016 Multi-University Training Contest 10


##题意:

求阴影面积.


##题解:

本渣不会算,只好百度搜图...
(http://f.hiphotos.baidu.com/zhidao/pic/item/83025aafa40f4bfbde8267a0024f78f0f63618f7.jpg)
(http://zhidao.baidu.com/question/571519797?&oldq=1)

![](http://images2015.cnblogs.com/blog/764119/201608/764119-20160818172723937-1109865998.png)


##代码:
/*注释部分的公式也可以*/
``` cpp
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define LL long long
#define eps 1e-8
#define maxn 110
#define mod 100000007
#define inf 0x3f3f3f3f
#define mid(a,b) ((a+b)>>1)
#define IN freopen("in.txt","r",stdin);
using namespace std;

int main(int argc, char const *argv[])

{

//IN;

int t; cin >> t;
while(t--)
{
double a; scanf("%lf", &a); //double ans = a*a/4.0 * asin(sqrt(14.0)/4.0);
//ans -= a*a * asin(sqrt(14.0)/8.0);
//ans += a*a * sqrt(7.0) / 8.0;
//ans *= 2.0; double ans = atan(sqrt(7.0)) / 4.0;
ans -= atan(sqrt(7.0)/5.0);
ans += sqrt(7.0) / 8.0;
ans *= a*a*2.0; printf("%.2f\n", ans);
} return 0;

}

HDU 5858 Hard problem (数学推导)的更多相关文章

  1. hdu 5105 Math Problem(数学)

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

  2. hdu 5312 Sequence(数学推导——三角形数)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5312 Sequence Time Limit: 2000/2000 MS (Java/Others)  ...

  3. HDU 5858 Hard problem

    Hard problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Tota ...

  4. hdu 5312 Sequence(数学推导+线性探查(两数相加版))

    Problem Description Today, Soda has learned a sequence whose n-th (n≥) item )+. Now he wants to know ...

  5. hdu 5430 Reflect (数学推导题)

    Problem Description We send a light from one point on a mirror material circle,it reflects N times a ...

  6. HDU 5105 Math Problem --数学,求导

    官方题解: f(x)=|a∗x3+b∗x2+c∗x+d|, 求最大值.令g(x)=a∗x3+b∗x2+c∗x+d,f(x)的最大值即为g(x)的正最大值,或者是负最小值.a!=0时, g′(x)=3∗ ...

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

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

  8. HDU 5073 Galaxy(Anshan 2014)(数学推导,贪婪)

    Galaxy Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total S ...

  9. UVA - 10014 - Simple calculations (经典的数学推导题!!)

    UVA - 10014 Simple calculations Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & ...

随机推荐

  1. 【转载】Javascript原型继承-学习笔记

    阮一峰这篇文章写的很好 http://www.ruanyifeng.com/blog/2011/06/designing_ideas_of_inheritance_mechanism_in_javas ...

  2. ASP.NET中动态获取数据使用Highcharts图表控件【Copy By Internet】

    具体实现的效果如图:

  3. 用Visio画UML顺序图

    1.顺序图 顺序图又称为时序图,顾名思义,它着重表现的是对象间消息传递的时间顺序.顺序图描述的对象也是一个用例,即一组行为操作,而它表现的是这组行为的先后关系(纵坐标),以及每个行为是属于哪个对象的( ...

  4. POJ2186 POPULAR COW

    链接:http://poj.org/problem?id=2186 题意:给你N个点,然后在给你N条有向边,然后让你找出这样的点S,S满足条件图上任意一点都能到达S. 要想满足任意一点都能到达,首先满 ...

  5. Android telnet RPi 2B

    /************************************************************************* * Android telnet RPi 2B * ...

  6. php 调试工具及学习PHP垃圾回收机制了解引用计数器的概念

    php代码工具:Xdebug  与分析工具 WinCacheGrind Xdebug之函数大全: string xdebug_call_class()返回当前被调用的函数或方法所属的类的类名 stri ...

  7. strust2 配置chainAction结果类型的配置

    <result name="chainAction" type="chain"> <param name="actionName&q ...

  8. EL&struts2标签 读取map,list集合

    struts中的取map和list & jsp中取map和list <% List list = new ArrayList(); list.add("a"); li ...

  9. HDU 4750

    解题方法,,,首先应该可以看出来是一颗 最小生成树,任意一条的边的价值是不同的:所以计算出最小生成树的每一条边有多少对顶点满足他的 f 值就是这条边的 权值,因此可以在生成最小生成树的时候,进行一下统 ...

  10. 搭建 MPICH3 并行计算环境

    先记录在单机MacBook上的搭建,实验室集群的搭建流程是一样的,不过每台机器都需要做一次. MacBook: 1.安装mpich3: $ ./configure --prefix=/Users/xi ...