HDU多赛学校9 HDU4969 Just a Joke 【数学积分】

数学题目

意甲冠军:的男孩向圆上的女孩跑去,保持男孩女孩圆心在同一条直线上。这过程中,男孩女孩均匀速

给出男孩女孩速度,圆的半径,男孩最长能跑的距离

问男孩是否能跑到女孩那里

 

能够用积分来解这道题,我们能够求出这个过程的总时间,t0。然后用t0乘以男孩的速度,再与男孩最长能跑的距离做比較

第一个公式表示的是沿着半径方向的速度

第二个公式第三个公式就是积分过程。最后得到t0(w=女孩速度除以半径)

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <iostream>
using namespace std;
int main(){
#ifndef ONLINE_JUDGE
	freopen("G:/in.txt","r",stdin);
	//freopen("G:/myout.txt","w",stdout);
#endif
	int T;
	scanf("%d",&T);
	double v1,v2,R,D;
	while(T--){
        scanf("%lf%lf%lf%lf",&v1,&v2,&R,&D);
        double ans=R/v1*(asin(v1/v2));
        if(ans*v2>D)
            printf("Why give up treatment
");
        else
            printf("Wake up to code
");
	}
}


 

 

 

 

版权声明:本文博客原创文章。博客,未经同意,不得转载。

原文地址:https://www.cnblogs.com/zfyouxi/p/4711047.html