HDU 4969 Just a Joke(积分)

HDU 4969 Just a Joke

题目链接

推公式,r=dr/dt=vy=v22v12r2/R2,可得积分公式为
R0y=1/v22v12x2/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;
}


你可能感兴趣的:(HDU 4969 Just a Joke(积分))