HDU 5858 Hard problem (数学推导)
2016-08-18 17:25
337 查看
Hard problem
题目链接:
http://acm.split.hdu.edu.cn/showproblem.php?pid=5858Description
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
11
Sample Output
0.29Source
2016 Multi-University Training Contest 10题意:
求阴影面积.题解:
本渣不会算,只好百度搜图...(http://f.hiphotos.baidu.com/zhidao/pic/item/83025aafa40f4bfbde8267a0024f78f0f63618f7.jpg)
(http://zhidao.baidu.com/question/571519797?&oldq=1)
代码:
/注释部分的公式也可以/#include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #include <queue> #include <map> #include <set> #include <stack> #include <vector> #include <list> #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-5858 Hard problem(数学)
- hdu 5858 Hard problem(2016 Multi-University Training Contest 10——数学题)
- HDU-5858 Hard problem(数学公式、计算几何)
- hdu_5858_Hard problem(数学题)
- hdu 5073/2014鞍山现场赛Galaxy(数学推导,尺取)
- HDU 5858 Hard problem(计算几何)
- hdu 1046 数学公式推导
- HDU 5073 Galaxy(Anshan 2014)(数学推导,贪婪)
- hdu 1719 Friend 数学推导
- 2016多校10 HDU 5858 Hard problem
- hdu 5734 Acperience(2016 Multi-University Training Contest 2——化简公式,数学推导)
- HDU-5935-Car(杭州CCPC C题)-数学推导+水贪心
- hdu 5858 Hard problem
- HDU 5858 Hard problem(求角度的模板)
- hdu 5312 Sequence【数学推导】
- HDU-5816-Hearthstone-DP+数学推导
- hdu 5312 Sequence(数学推导——三角形数)
- HDU1719 Friend (数学推导)
- HDU 5858 Hard problem (2016 多校训练#10 1002)