HDU 4969 Just a Joke(积分)

HDU 4969 Just a Joke

pid=4969" target="_blank" style="">题目链接

推公式,r′=dr/dt=vy=v22−v12r2/R2−−−−−−−−−−−−√,可得积分公式为

R0y=1/v22−v12x2/R2−−−−−−−−−−−−−√,利用三角换元去化简就可以

代码:

#include <cstdio>
#include <cstring>
#include <cmath> typedef long long ll; int t;
double v1, v2, r, d; int main() {
scanf("%d", &t);
while (t--) {
scanf("%lf%lf%lf%lf", &v1, &v2, &r, &d);
double ti = asin(r * v1 / r / v2) * r / v1 - asin(0.0) * r / v1;
if (ti * v2 > d) printf("Why give up treatment\n");
else printf("Wake up to code\n");
}
return 0;
}
上一篇:java并发编程(三)线程挂起,恢复和终止的正确方法


下一篇:前端安全之XSS攻击及防御