HDU 4969 Just a Joke (数学题)

Just a Joke

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 112    Accepted Submission(s): 25


Problem Description
Here is just a joke, and do not take it too seriously.

Guizeyanhua is the president of ACMM, and people call him President Guizeyanhua. When Guizeyanhua is walking on the road, everyone eyes on him with admiration. Recently, Guizeyanhua has fallen in love with an unknown girl who runs along the circular race track on the playground every evening. One evening, Guizeyanhua stood in the center of the circular race track and stared the girl soulfully again. But this time he decided to catch up with the girl because of his lovesickness. He rushed to the girl and intended to show her his love heart. However, he could not run too far since he had taken an arrow in the knee. 

Now your task is coming. Given the maximum distance Guizeyanhua can run, you are asked to check whether he can catch up with the girl. Assume that the values of Guizeyanhua's and the girl's velocity are both constants, and Guizeyanhua, the girl, and the center of the circular race track always form a straight line during the process. Note that the girl and Guizeyanhua can be considered as two points.

 

Input
The input begins with a line containing an integer T (T<=100000), which indicates the number of test cases. The following T lines each contain four integers V1, V2, R, and D (0<V1, V2, R, D<=10^9, V1<=V2). V1 is the velocity of the girl. V2 is the velocity of Guizeyanhua. R is the radius of the race track. D is the maximum distance President Guizeyanhua can run.
 

Output
For each case, output "Wake up to code" in a line if Guizeyanhua can catch up with the girl; otherwise output "Why give up treatment" in a line.
 

Sample Input
  
  
2 1 1 1 1 11904 41076 3561 3613
 
Sample Output
  
  
Why give up treatment Wake up to code
 

Source
 

多校也算做了几场了。。感觉自己一直在拉学长后腿,但今天应该是感觉做的比较好的一次了。把这道题贴出来也是纪念一下自己第一次给队里做了一点贡献。。感觉自己还是太弱了,一定要好好学才行。一定不能拖学长的后腿。


题意:一个人从圆心出发,以v2的绝对速度追赶另一个以v1做圆周运动的人(半径为R),然后问能否在路程小于D的情况下追赶上。


分析:非常容易的一道物理题,分析一下追赶者的速度,对其进行分解,列出积分式,可以把总的运动时间t积出来。然后路程就是t*v2

积分式如下:


然后就可以判断t*v2与D的大小然后输出了。


AC代码:

#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int v1,v2,d,r;
int main()
{
    int T;
    cin>>T;
    while(T--){
        scanf("%d%d%d%d",&v1,&v2,&r,&d);
        double ans = r/(double)v1*v2*asin(v1/(double)(v2));
        if(ans>d)printf("Why give up treatment\n");
        else printf("Wake up to code\n");
    }
    return 0;
}



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值