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. Java NIO 读数据处理过程

    这两天仿hadoop 写java RPC框架,使用PB作为序列号工具,在写读数据的时候遇到一个小坑.之前写过NIO代码,恰好是错误的代码产生正确的逻辑,误以为自己写对了.现在简单整理一下. 使用NIO ...

  2. Eclipse 文本显示行号

  3. zoj The 12th Zhejiang Provincial Collegiate Programming Contest May Day Holiday

    http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5500 The 12th Zhejiang Provincial ...

  4. poj: 2255

    跟LEETCODE的preorder,inorder转postorder题很像 #include <iostream> #include <stdio.h> #include ...

  5. VS2013中的快捷键

    在VS2012中Ctrl+E+D 是对齐代码,然而在VS2013中变成了Ctrl+K+F #region的快捷键 Ctrl+K+S /// <summary> 快捷键 先写好函数或方法,然 ...

  6. yii2获取登陆的用户名

    yii2获取登陆的用户名: yii::$app->user->identity->username; 判断用户名是否登陆 if(Yii::$app->user->isGu ...

  7. 弹出层和ajax数据交互

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs& ...

  8. Sql Server Analysis Service 转换为UnknownMember的正确设置

    在SSAS中事实表数据被归类到为UnknownMember 的时候分为两种情况: 第一种情况,在SSAS里面事实表中的外键是null,这种情况SSAS在建事实表和维度时ErrorConfigurati ...

  9. string与char之间的互相转换

    string对象是一种很强大的存在哈~~ 1. string转const char* string s = "abc"; const char* c_s = s.c_str(); ...

  10. 关于事件触发的一个小tips

    今天看到如下代码 window.globalEvent.bind('hotelHotTableRendered', function () { $('#hotelHotTd a').each(func ...