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. 如何使用matlab中的胞元数组

    胞元数组(cell Arry)的基本组分是胞元(cell),每个胞元本身在数组中是平等的,只能以下标区分.胞元可以存放任何类型.任何大小的数组,如任意维数值数组.字符串数组.符号对象等,而且同一个胞元 ...

  2. 九度 1537:买卖股票(区间DP)

    总结 1. 更新动规矩阵时, 不要 push 更新, 要用 pull更新. push 更新容易让逻辑出问题, 自己卡了很久, 改用 pull 就变得很顺利了 2. acm 题, 空间至多是百万, 再网 ...

  3. Oracle-随机数获取

    1.获取10-100的数据,保留两位小数 select trunc(dbms_random.value(10,100),2) from dual ; 2.获取0-1的小数 select dbms_ra ...

  4. 服务器允许js跨域

    header('Access-Control-Allow-Origin:*'); header('Access-Control-Allow-Methods:POST,GET'); header('Ac ...

  5. 【渗透测试学习平台】 web for pentester -5.代码执行

    Example 1 http://192.168.106.154/codeexec/example1.php?name=".system('uname -a');// Example 2 h ...

  6. Android package属性、package name和Application ID三者的联系及区别

    package属性:在AndroidManifest.xml文件中. package name:模块结构的包名. Application ID:模块defaultConfig块下的applicatio ...

  7. 《C++ Primer Plus》10.3 类的构造函数和析构函数 学习笔记

    10.3.1 声明和定义构造函数构造函数原型:// constructor prototype with some default argumentsStock(const string &c ...

  8. JS面向对象编程学习

    学习目标:1.掌握JS中的类(原型对象)和对象.2.什么是成员变量和成员方法.3.掌握构造方法的使用.补充:关于双等号(==):1.如果等号两边都是字符串时,则比较内容是否相等2.如果等号两边是数字时 ...

  9. MYSQL系列之(一)

      mysql简介 1.什么是数据库 ? 数据库(Database)是按照数据结构来组织.存储和管理数据的仓库,它产生于距今六十多年前,随着信息技术和市场的发展,特别是二十世纪九十年代以后,数据管理不 ...

  10. split()有个坑

    刚才在做DBMS课程设计的时候遇到了一个以前遇到过的问题不过这次我没有一眼认出来,想了好一会才想起来. 就是在用split()方法来分割路径名字符串的时候,比如 String path = “E:\s ...