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】运动目标检测之“帧差法”

    videoObj = VideoReader('4.avi');%读视频文件 nframes = get(videoObj, 'NumberOfFrames');%获取视频文件帧个数 : nframe ...

  2. 【matlab】图像直方图

    使用imhist函数(要先用rgb2gray转化为灰度图像) 利用matlab计算图像直方图函数为imhist() 具体用法: imhist( i );直接显示图像i的灰度直方图: imhist(i, ...

  3. 静默安装oracle 11g,环境预检查时报错,SEVERE: [FATAL] PRVF-0002 : 无法检索本地节点名

    环境描述: 操作系统:Redhat 6.6_x64 oracle:11.2.0.4 x64 问题描述: 今天在安装oracle 11g的数据库,在进行预安装环境检查的时候,报下面的错误: [oracl ...

  4. day05<Java语言基础--数组>

    Java语言基础(数组概述和定义格式说明) Java语言基础(数组的初始化动态初始化) Java语言基础(Java中的内存分配以及栈和堆的区别) Java语言基础(数组的内存图解1一个数组) Java ...

  5. swift开发之--UISearchBar的使用/UISearchController的使用

    记录下UISearchBar的基本用法,补充:ios 8.0以后,原来的UISearchDisplayController被官方废弃,建议使用UISearchController,下面就简单的记录下这 ...

  6. laravel 控制器多个方法共用一个路由

    直接上代码: Route::get('Index/{action}', function(App\Http\Controllers\IndexController $index, $action){ ...

  7. Python 入门(八)切片

    对list进行切片 取一个list的部分元素是非常常见的操作.比如,一个list如下: >>> L = ['Adam', 'Lisa', 'Bart', 'Paul'] 取前3个元素 ...

  8. Spring中通过构造方法传参数

    1.实体类 package com.xbq.bean;import java.util.Timer; /** * @ClassName: Student * @Description: TODO 学生 ...

  9. C语言各种存储模式的区别?最常用的存储模式有哪些?

    DOS用一种段地址结构来编址计算机的内存,每一个物理内存位置都有一个可通过段地址一偏移量的方式来访问的相关地址.为了支持这种段地址结构,大多数C编译程序都允许你用以下6种存储模式来创建程序: ---- ...

  10. MQTT--单片机实现即时通信

    链接--->http://blog.csdn.net/zhou6343178/article/details/51182623 1.准备条件: a)硬件:ATMEGA644PA 8位单片机 EN ...