http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2877

题目描述

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

提示

数学知识学得很不扎实,很大程度程度上是在应付考试,导致不会灵活运用,在高中这种题手到擒来,但现在感觉做的有点费事。

来源

2014年山东省第五届ACM大学生程序设计竞赛
 
#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std; int main()
{
int T;
double px,tx,t,ty,sum,a;
cin>>T;
while(T--)
{
cin>>px>>tx>>a;
t=(tan(a)*px)/(tx*tx-2.0*tx*px);
ty=t*tx*tx+tx*tan(a);
sum=(0.5*(px-tx)*ty)+(/3.0*t*tx*tx*tx+0.5*tan(a)*tx*tx);
printf("%.3lf\n",sum);
}
return ;
}

简单数学题,大神的思路

//题意:求由实线O-Tappingposition-Pig-O所围成图形的面积 s.

#include<stdio.h>
#include<math.h>
int main()
{
int n;
scanf("%d",&n);
while(n--)
{
int t,p;
double a,t1,t2;
scanf("%d%d%lf",&p,&t,&a);
t1=p*t*(*p-*t);
t2=*(*p-t);
printf("%.3lf\n",t1/t2*tan(a));
}
return ;
}
/*由题意可设抛物线方程为f(x)=a*x^2+b*x ,Tap点的纵坐标为 y,
由O-Tappingposition-Tx-O所围成图形的面积为 s1,
由Tx-Tappingposition-pig-Tx所围成图形的面积为s2.
f'(x)=2*a*x+b
s=s1+s2 ...... (1)
s2=1/2*(px-tx)*y ...... (2)
s1=1/3*a*tx^3+1/2*b*tx^2 ...... (3)
f'(0)=tan(a) => b=tan(a) ...... (4)
f(tx)=y => a*tx^2+b*tx=y ...... (5)
f'(tx)=-y/(px-tx) => 2*a*tx+b=-y/(px-tx) ...... (6)
联立(1)(2)(3)(4)(5)(6)解得:s=[px*tx*(3*px-2*tx)]/[6*(2*px-tx)]*tan(a)*/

angry_birds_again_and_again(2014年山东省第五届ACM大学生程序设计竞赛A题)的更多相关文章

  1. 2014年山东省第五届ACM大学生程序设计竞赛F题:Full Binary Tree

    题目描述 In computer science, a binary tree is a tree data structure in which each node has at most two ...

  2. “浪潮杯”山东省第五届ACM大学生程序设计竞赛(总结贴)

    第一次參加省赛有点小激动,尽管是作为打星队參赛,但心情却是上下起伏. 5月9号晚上11点多到威海,有点略冷.可是空气比淄博好多了,大家到了旅馆的时候都非常晚了,抱怨了一下三星级的酒店的待遇,喝杯咖啡早 ...

  3. 2013年山东省第四届ACM大学生程序设计竞赛J题:Contest Print Server

    题目描述     In ACM/ICPC on-site contests ,3 students share 1 computer,so you can print your source code ...

  4. 2013年山东省第四届ACM大学生程序设计竞赛E题:Alice and Bob

    题目描述 Alice and Bob like playing games very much.Today, they introduce a new game. There is a polynom ...

  5. 2013年山东省第四届ACM大学生程序设计竞赛-最后一道大水题:Contest Print Server

    点击打开链接 2226: Contest Print Server Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 53  Solved: 18 [Su ...

  6. Alice and Bob(2013年山东省第四届ACM大学生程序设计竞赛)

    Alice and Bob Time Limit: 1000ms   Memory limit: 65536K 题目描述 Alice and Bob like playing games very m ...

  7. 山东省第四届ACM大学生程序设计竞赛解题报告(部分)

    2013年"浪潮杯"山东省第四届ACM大学生程序设计竞赛排名:http://acm.upc.edu.cn/ranklist/ 一.第J题坑爹大水题,模拟一下就行了 J:Contes ...

  8. [2012山东省第三届ACM大学生程序设计竞赛]——n a^o7 !

    n a^o7 ! 题目:http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2413 Time Lim ...

  9. sdut Mountain Subsequences 2013年山东省第四届ACM大学生程序设计竞赛

    Mountain Subsequences 题目描述 Coco is a beautiful ACMer girl living in a very beautiful mountain. There ...

随机推荐

  1. catch(…) vs catch(CException *)?

    转自:https://stackoverflow.com/questions/7412185/what-is-the-difference-between-catch-vs-catchcexcepti ...

  2. plsql developer中,清除登录历史

    需求描述: 在使用plsql developer的时候,发现登录的时候,有太多的历史,想要把这些登录历史清除掉, 在此记录下. 操作过程: 1.登录plsql developer(或者在登录时取消也会 ...

  3. TTCN中PTC的执行流程

    一些概念 Component(測试组件或者測试成分),TTCN接触下来最频繁的就是MTC(Main Test Component,主測试组件),在执行測试用例前,须要首先创建一个MTC.在testca ...

  4. cgitb--CGI跟踪模块(简化异常调试)

    通过启动cgitb模块,可以在web浏览器窗口查看详细的编码异常信息,而不必不停地跳转到web服务器的日志屏幕查看,更方便的定位问题: 异常解决后需关闭CGI跟踪. 在CGI脚本最前面增加如下两行,启 ...

  5. remove()

    remove() 用于从列表中删除指定的元素 In [35]: l = ['a', 'b', 'c'] In [36]: l.remove('b') In [37]: l Out[37]: ['a', ...

  6. Effective C++ —— 继承与面向对象设计(六)

    条款32 : 确定你的public继承塑模出is-a关系 以C++进行面向对象编程,最重要的一个规则是:public inheritance(公开继承)意味“is-a”(是一种)的关系.请务必牢记.当 ...

  7. 【Thinkphp5 】部署nginx时nginx.conf配置文件修改

    背景:thinkphp5项目 服务器环境: lnmp 1 打开路径  /usr/local/nginx/conf/vhost/ 此路径下会有你添加的域名文件夹..找到对应的域名打开. 2  代码如下, ...

  8. LeetCode - Department Highest Salary

    题目大概的意思是选出每个Department里工资最高的人的信息并组成相应的表信息 有几个值得注意的地方:1)使用group by语句时,前面的select语句后面的内容只能有两种情况一种是group ...

  9. ReactNative For Android 框架启动核心路径剖析

    版权声明:本文由王少鸣原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/144 来源:腾云阁 https://www.qclo ...

  10. 【原创】asp.net内部原理(三) 第三个版本 (最详细的版本)

    前言: 今天继续吧这个系列补齐,这几天公司的项目比较忙,回到家已经非常的累了,所以也没顾得上天天来这里分享一些东西和大家一起探讨,但是今天晚上我还是坚持打开电脑,分享一些asp.net生命周期的知识, ...