L3-013 非常弹的球 (30 分)
设掷出的角度为θ
m
=
w
100
m = \frac{w}{100}
m=100w
E = m v 2 2 E=\frac{mv^2}{2} E=2mv2
v 2 = 2 E m v^2=\frac{2E}{m} v2=m2E
V x = 2 E ∗ 100 w ∗ c o s θ V_x=\sqrt{\frac{2E*100}{w}}*cosθ Vx=w2E∗100∗cosθ
V y = 2 E ∗ 100 w ∗ s i n θ V_y=\sqrt{\frac{2E*100}{w}}*sinθ Vy=w2E∗100∗sinθ
t = 2 V y g t=\frac{2V_y}{g} t=g2Vy
S = 2 V x V y g = 4 E ∗ 100 w s i n θ c o s θ = 2 E ∗ 100 w g s i n 2 θ S=\frac{2V_xV_y}g =\frac{4E*100}{w}sinθcosθ =\frac{2E*100}{wg}sin2θ S=g2VxVy=w4E∗100sinθcosθ=wg2E∗100sin2θ
当θ=45°时S最大
#include <iostream>
#include <iomanip>
using namespace std;
int w, p;
double v, s;
int main()
{
cin >> w >> p;
v = 2.0 * 1000 * 100 / w;
while (v > 0.00001)
{
s += v / 9.8;
v *= (100 - p) * 0.01;
}
cout << setprecision(3) << fixed << s << endl;
return 0;
}