标签:des style blog http io color ar os for
http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2877
1 2 1 1.0
0.692
#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)+(1/3.0*t*tx*tx*tx+0.5*tan(a)*tx*tx); printf("%.3lf\n",sum); } return 0; }
简单数学题,大神的思路
//题意:求由实线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*(3*p-2*t); t2=6*(2*p-t); printf("%.3lf\n",t1/t2*tan(a)); } return 0; } /*由题意可设抛物线方程为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题)
标签:des style blog http io color ar os for
原文地址:http://www.cnblogs.com/zhangmingcheng/p/4069731.html