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 (α).

∠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 < α <  ) .

输出

One line for each case specifying the distance rounded to three digits.

示例输入

1
2 1 1.0

示例输出

0.692

数学题:已知一个二次函数过零点的角度,已知另外一条切线,求x轴与直线和二次函数包围的取余面积
#include <iostream>
#include <cmath>
#include <cstdio>using namespace std;int T,n,px,tx;
double s1,s2,b,c;
float a;int main()
{cin >> T;while(T--){cin >> px >> tx >> a;c = tan(a);b = c * px / (tx * tx - 2 * px * tx);//cout << b << endl;s1 = b / 3.0 * (tx * tx * tx) + c / 2.0 * tx * tx;//cout << s1 << endl;s2 = 1 / 2.0 * (b * tx * tx + c * tx) * (px - tx);//cout << s2 << endl;printf("%.3lf\n",s1 +s2);}return 0;
}

angry_birds_again_and_again SD5THACM相关推荐

最新文章

  1. XFile 关键帧动画的解析遇到的问题
  2. 世界硬币:比特币类似的评分系统!
  3. python计算机视觉编程(全)(强烈推荐)_推荐一个计算机视觉图书:python计算机视觉编程...
  4. android 如何使用aar,Android Studio如何使用aar依赖包?
  5. php apache停止工作,phpStudy Apache 经常出现停止工作
  6. MyEclipse6.5安装SVN插件的三种方法
  7. pythonfor循环加2_python中for循环如何实现每次控制变量翻倍
  8. yum 配置详解(转发)
  9. 笔记︱多种常见聚类模型以及分群质量评估(聚类注意事项、使用技巧)
  10. WCF 4.0一个鲜为人知的改变[兼书名征集]
  11. 十九、CSS如何引入字体
  12. Java设计模式(十二)----享元模式
  13. 阿里云服务器搭建后台(Ubuntu)
  14. RGB与HSB之间的转换公式
  15. android ViewPager2的使用教程
  16. 一文读大厂微服务水平
  17. win10笔记本网络重置后没有网络连接了
  18. P4238 【模板】多项式乘法逆
  19. 公安部:河南特大套路贷受害人超95%为在校大学生
  20. 视频码率,帧率和分辨率

热门文章

  1. 任达华主演的《重回地球》宣布正式杀青
  2. 不使用ATS Lighting Box,也能抓CarPlay和iAP数据
  3. Erlang程序设计笔记---(第五节 Erlang的记录与映射组)
  4. 2019年网页设计趋势前瞻,先睹为快
  5. 嵌入式工控机主板在自动售货机的应用
  6. 科技创业捷径 网络电话进军通信大道至简
  7. 关于蹭网检查的原理及实现
  8. 【Python】练习1-数字人民币转大写
  9. java向数据库插入数据时的错误: Duplicate entry ‘‘ for key ‘PRIMARY‘ 问题解决
  10. C语言怎么判断字符YN,c语言中的宏_详解(转)