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

提示

 

来源

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;
}

SDUT 2877:angry_birds_again_and_again的更多相关文章

  1. angry_birds_again_and_again(2014年山东省第五届ACM大学生程序设计竞赛A题)

    http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2877 题目描述 The problems ca ...

  2. 【叉积】【sdut 2508 图形密码】

    图形密码 Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 题目链接:http://acm.sdut.edu.cn/sdutoj/p ...

  3. sdut 1592转置矩阵【稀疏矩阵的压缩存储】【快速转置算法】

    转置矩阵 Time Limit: 1000ms   Memory limit: 32768K  有疑问?点这里^_^ 题目链接:http://acm.sdut.edu.cn/sdutoj/proble ...

  4. sdut 2125串结构练习--字符串匹配【两种KMP算法】

    串结构练习——字符串匹配 Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目链接:http://acm.sdut.edu.cn/sduto ...

  5. sdut 2498【aoe 网上的关键路径】

    http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2498 代码超时怎么破: #include< ...

  6. sdut 487-3279【哈希查找,sscanf ,map】

    487-3279 Time Limit: 2000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 题目链接: sdut:   http://acm.sdut.ed ...

  7. sdut 1465 公共因子

    公共因子 Time Limit: 1000MS Memory limit: 65536K 题目描述 题目链接:http://acm.sdut.edu.cn/sdutoj/problem.php?act ...

  8. 排队打饭 sdut 2443【最简单的贪心法应用举例】

    排队打饭 Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 题目链接:http://acm.sdut.edu.cn/sdutoj/p ...

  9. sdut 2445 小学数学

    小学数学 Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 题目链接:http://acm.sdut.edu.cn/sdutoj/p ...

随机推荐

  1. set ver on/off

    set   verify(或ver)   on/off可以设置是否显示替代变量被替代前后的语句 SQL> set verify on SQL> select &num from d ...

  2. Python学习总结9:目录操作方法汇总

    os.getcwd():得到当前工作目录,即当前Python脚本工作的目录路径os.listdir():返回指定目录下的所有文件和目录名os.remove():函数用来删除一个文件os.removed ...

  3. Eclipse下Ruby的配置]

      简述: 在Eclipse中开发Ruby开发环境   步骤: 第一步, 1. 在Eclipse的Help ->  Install New Software输入 http://download. ...

  4. extjs 常见的小问题

    今天,小白就来总结下extjs的使用的时候的各种小问题或者说是小技巧.希望能够给各位刚接触extjs的朋友一点帮助. 1.当存在store的各种组件的store的autoload属性为false的时候 ...

  5. .NET 4.0 MemoryCache with SqlChangeMonitor

    Summary There isn't a lot of documentation on the internet about how to use the SqlChangeMonitor wit ...

  6. paper 65 :尺度不变特征变换匹配算法[转载]

    尺度不变特征变换匹配算法 对于初学者,从David G.Lowe的论文到实现,有许多鸿沟,本文帮你跨越.1.SIFT综述 尺度不变特征转换(Scale-invariant feature transf ...

  7. react tab

    <!DOCTYPE html> <html> <head> <script src="js/react.js"></scrip ...

  8. zw版【转发·台湾nvp系列Delphi例程】.NET调用HALCON COM控件内存释放模式

    zw版[转发·台湾nvp系列Delphi例程].NET调用HALCON COM控件内存释放模式 ------------------------------------方法一 :Imports Sys ...

  9. ionic入门之AngularJS扩展(一)

    ionic ionic是一个强大的混合式/hybridHTML5移动开发框架,特点是使用标准的HTML. CSS和JavaScript,开发跨平台(目前支持:Android.iOS,计划支持:Wind ...

  10. Windows 10 访问网络共享 总是提示用户名或密码不正确的解决方法

    今天同事在Windows10上共享了一些文件,其他使用Windows 7的同事都可以正常使用,唯独我是使用Windows 10操作系统的,和别人输入一样的用户名和密码,却总是告诉我:用户名或密码不正确 ...