//传送门: https://www.patest.cn/contests/gplt/L3-013
#include <queue>
#include <functional>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <assert.h>
using namespace std;
/*题意:
高中物理题
设质量为w、总能量为1000的小球弹出时与地面的夹角为 @,速度为 v,
则小球的垂直速度为 v*cos@ ,水平速度为 v*sin@
小球从弹出到第一次落地的时间为 t = 2*(vcos@ / g),第一次水平移动距离 s1 = v*sin*t = 2sin@cos@(v^2)/g
当 @ = 45度时,有s1(max) = v^2/g
第二次能量缩减为第一次的 1-p/100,为等比数列 1/(1-(1-p/100)) = 1/p
等比求和即可 s(max) = s1(max) + s2(max) + s3(max) + ……
答案为 2000./w/g/p
*/
#define N 100005
#define M 1000005
int main()
{
double w,p;
scanf("%lf%lf",&w,&p);
w /= 100.;
p = p / 100.;
printf("%.3lf",2000./w/9.8/p);
return 0;
}
PAT-练习集-L3-013. 非常弹的球
最新推荐文章于 2022-04-07 21:34:31 发布