cccc L3-013. 非常弹的球

来源:互联网 发布:科目二模拟软件 编辑:程序博客网 时间:2024/05/18 04:53


点击打开链接


这是一道物理题,不难,真的不难,但是当时就是因为时间太短,在现场犯傻逼症了,结果就gg了。


这题没写出来,该背锅。


一眼扫除45°。    就算不知道二分也能出来。

然后速度分解,上右各一半,  mgh=E  ;

   gt=v;

得出最终时间t 和水平速度v。

x=vt;

ans=(v1t1+ v2t2+。。。。。 )*2;

精度高点就行了。


#include <bits/stdc++.h>#define ll long longusing namespace std;const int maxn=1e5+10;int main(){    double w,p;    double m,ans=0,t,g=9.8;    cin>>w>>p;    double e=1000.0;    m=w/100;    while(e>0.00000001){        ans+=(e/m)/g;         e=e-e*p/100;    }    printf("%.3lf",ans*2);    return 0;}


0 0
原创粉丝点击