SDUT 2877:angry_birds_again_and_again
2016-04-21 21:20
375 查看
angry_birds_again_and_again
Time Limit: 2000ms Memory limit: 65536K 有疑问?点这里^_^
题目描述
The problems called "Angry Birds" and "Angry Birds Again and Again" has been solved by many teams in the series of contest in 2011 Multi-University Training Contest.This time we focus on the yellow bird called Chuck. Chuck can pick up speed and distance when tapped.
You can assume that before tapped, Chuck flies along the parabola. When tapped, it changes to fly along the tangent line. The Chuck starts at the coordinates (0, 0). Now you are given the coordinates of the pig (Px, 0),
the x-coordinate of the tapping position (Tx) and the initial flying angle of Chuck (α).
![](http://acm.sdut.edu.cn/image/2877_1.png)
∠AOx = α
Please calculate the area surrounded by Chuck’s path and the ground.(The area surrounded by the solid line O-Tapping position-Pig-O)
输入
The first line contains only one integer T (T is about 1000) indicates the number of test cases. For each case there are two integers, px tx, and a float number α.(0 < Tx ≤ Px ≤ 1000, 0 < α < ![](http://acm.sdut.edu.cn/image/2877_2.png)
)
.
输出
One line for each case specifying the distance rounded to three digits.
示例输入
1 2 1 1.0
示例输出
0.692
提示
来源
2014年山东省第五届ACM大学生程序设计竞赛
迷失在幽谷中的鸟儿,独自飞翔在这偌大的天地间,却不知自己该飞往何方……
题意:给出两个函数,定积分求区域面积。
#include <stdio.h> #include <math.h> int main() { int T; double c,t,p; scanf("%d",&T); while(T--) { scanf("%lf%lf%lf",&p,&t,&c); double b=tan(c); double a=b*p/(2*t*t-2*p*t-t*t); double area=(1/3.0)*a*t*t*t+0.5*b*t*t+(p-t)*(a*t*t+b*t)*0.5; printf("%.3lf\n",area); } return 0; }
相关文章推荐
- LightOJ 1076 Get the Containers
- 【Light】[1076 ]Get the Containers
- 阶梯博弈(Staircase Nim)
- Dispatcher initialization failed:Unable to load configuration
- light oj 1076 - Get the Containers
- 哈佛大学研究新人工智能系统 速度媲美人类大脑
- HDU 2820 Permutaion
- Fibonacci Again
- POJ3691.DNA repair (Trie图 && DP)
- com.google.android.xts.devicepolicy.DeviceOwnerTest#testFactoryResetProtection fail
- AIDL API级别详细解释
- BZOJ 3172 [Tjoi2013]单词 AC自己主动机(fail树)
- linker command failed with exit code 1 (use -v to see
- ping: unknown host www.baidu.com 最简单的方法
- 严重: StandardServer.await: create[localhost:8005]
- HDU 5319 Painter
- A. Reconnaissance 2
- A. Reconnaissance
- HDU 1839 Delay Constrained Maximum Capacity Path
- HDU1789 Doing Homework again(贪心)