PAT-练习集-L3-013. 非常弹的球

//传送门: 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;
}



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值