首页 > 代码库 > HDU 4969 Just a Joke(积分)

HDU 4969 Just a Joke(积分)

HDU 4969 Just a Joke

题目链接

推公式,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;
}


HDU 4969 Just a Joke(积分)