HDU 5858 Hard problem (数学推导)
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?

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)

##代码:
/*注释部分的公式也可以*/
``` 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 (数学推导)的更多相关文章
- hdu 5105 Math Problem(数学)
pid=5105" target="_blank" style="">题目链接:hdu 5105 Math Problem 题目大意:给定a.b ...
- hdu 5312 Sequence(数学推导——三角形数)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5312 Sequence Time Limit: 2000/2000 MS (Java/Others) ...
- HDU 5858 Hard problem
Hard problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Tota ...
- hdu 5312 Sequence(数学推导+线性探查(两数相加版))
Problem Description Today, Soda has learned a sequence whose n-th (n≥) item )+. Now he wants to know ...
- hdu 5430 Reflect (数学推导题)
Problem Description We send a light from one point on a mirror material circle,it reflects N times a ...
- 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∗ ...
- HDU 5858 Hard problem ——(计算几何)
其实这题最多是个小学奥数题- -,,看到别人博客各显神通,也有用微积分做的(我也试了一下,结果到最后不会积...). 思路如下(这两张图是网上找来的): 然后就很简单了,算三角形面积可以用海伦公式,也 ...
- HDU 5073 Galaxy(Anshan 2014)(数学推导,贪婪)
Galaxy Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total S ...
- UVA - 10014 - Simple calculations (经典的数学推导题!!)
UVA - 10014 Simple calculations Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & ...
随机推荐
- 非常非常非常好!path-sum-iii
https://leetcode.com/problems/path-sum-iii/ 最终我还是没做出好的解法.还是看的别人的解法. 即使看了别人的解法,开始还实现错了. 还有很长的路要走. pac ...
- ADO与ADO.NET的区别与介绍
1. ADO与ADO.NET简介ADO与ADO.NET既有相似也有区别,他们都能够编写对数据库服务器中的数据进行访问和操作的应用程序,并且易于使用.高速度.低内存支出和占用磁盘空间较少,支持用于建立基 ...
- Java RGB数组图像合成 ImageCombining (整理)
/** * Java RGB数组图像合成 ImageCombinning (整理) * * 2016-1-2 深圳 南山平山村 曾剑锋 * * 注意事项: * 1.本程序为java程序,同时感谢您花费 ...
- pycharm Working directory error
/***************************************************************************** * pycharm Working dir ...
- HDU 3573 Buy Sticks (逻辑)
题意:a,b,c三种棍子长度分别为20,28,32,现需要这三种棍子数根,欲买长为75的棍子来剪成这三种(不够长的就废弃) ,问需要买多少根. 思路:将所有棍子尽可能和其他搭配起来,使得数量减到最少. ...
- HDU5463 Clarke and minecraft
解题思路:此题刚开始,觉得好繁琐,好混乱,理清思路后,发现很简单. 具体见代码分析. #include<cstdio> #include<cstring> #include ...
- Android 签名详解
Android 签名详解 AndroidOPhoneAnt设计模式Eclipse 在Android 系统中,所有安装 到 系统的应用程序都必有一个数字证书,此数字证书用于标识应用程序的作者和在应用程 ...
- 【转】让Souce Insight支持多种语言的语法高亮:Python,Ruby,ARM汇编,windows脚本文件(bat/batch),PPC,SQL,TCL,Delphi等
原文网址:http://www.crifan.com/source_insight_support_highlight_for_python_ruby_arm_batch_ppc_sql_tcl_de ...
- css3 :nth-child 常用用法
前端的哥们想必都接触过css中一个神奇的玩意,可以轻松选取你想要的标签并给与修改添加样式,是不是很给力,它就是“:nth-child”. 下面我将用几个典型的实例来给大家讲解:nth-child的实际 ...
- Multi-Device Hybrid Apps for Visual Studio CTP2.0
http://msdn.microsoft.com/en-us/library/dn771545.aspx http://www.microsoft.com/en-us/download/detail ...