hdu 4946 Just a Joke(数学+物理)

链接:http://acm.hdu.edu.cn/showproblem.php?pid=4969

Just a Joke

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

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

Author

SYSU

、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、

------------------------------------------------------------------------------------------------------------

第九场多校,居然出了这样一道题,纯物理+纯数学,表示很无语啊

题目意思就是圆中间一个人,喜欢在圆环上匀速圆周运动的女孩,现在他要去追那个女孩,向她表白

在任意时刻,圆心,这两个人都在一条直线上,并且那个男的只能走长度为D的距离

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

题解就不想写了,这里很详细:http://blog.csdn.net/u011775691/article/details/38691623

 1 #include <stdio.h>
 2 #include <string.h>
 3 #include <stdlib.h>
 4 #include <math.h>
 5
 6 int main()
 7 {
 8     int T;
 9     scanf("%d",&T);
10     while(T--)
11     {
12         double V1,V2,R,D;
13         scanf("%lf%lf%lf%lf",&V1,&V2,&R,&D);
14         double ans=R/V1*asin(V1/V2);
15         if(ans*V2 > D)
16         {
17             printf("Why give up treatment\n");
18         }
19         else printf("Wake up to code\n");
20     }
21     return 0;
22 }

hdu 4946 Just a Joke(数学+物理)

时间: 2024-10-08 02:52:21

hdu 4946 Just a Joke(数学+物理)的相关文章

hdu 4969 Just a Joke(积分)

题目链接:hdu 4969 Just a Joke 题目大意:Guizeyanhua要去追一个女孩,女孩在以Guizeyanhua为圆心,半径为R的圆上匀速运动,女孩的速度为v1,Guizeyanhua的速度为v2,半径为R,Guizeyanhua腿疼只能跑距离D.现在Guizeyanhua要去追女孩,前提条件是女孩,Guizeyanhua,圆心必须保持共线. 解题思路:因为有三点要共线的条件,所以Guizeyanhua和女孩的线速度必须相同,所以有v1R=vxr(vx为Guizeyanhua在

HDU 4405 飞行棋上的数学期望

突然发现每次出现有关数学期望的题目都不会做,就只能找些虽然水但自己还是做不出的算数学期望的水题练练手了 题目大意: 从起点0点开始到达点n,通过每次掷色子前进,可扔出1,2,3,4,5,6这6种情况,扔到几前进几,当然对应飞行通道可以通过x直达一点y,x<y,计算到达n点或超过n 点要扔色子的次数的数学期望 从某一点 i 扔完色子可到达 i+1,i+2,i+3,i+4,i+5,i+6这6个点,令dp[i]为到达末尾的数学期望 那么到达之后6个点的数学期望是一样的,那么dp[i]=dp[i+1]*

hdu 4869 Turn the pokers(数学)

题目链接:hdu 4869 Turn the pokers 题目大意:给定n和m,表示有n次翻牌的机会,m张牌,一开始所有的牌均背面朝上,每次翻牌可以选择xi张牌同时翻转.问说最后有多少种能. 解题思路:只要确定最后正面朝上的牌的个数即可.所以在读入xi的时候维护上下限即可. #include <cstdio> #include <cstring> #include <algorithm> using namespace std; typedef long long l

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 mai

HDU 4946 Area of Mushroom(凸包)

如果一个人能统治无穷远处,那么他的速度一定是最大的.除了那几种很坑的数据,比如同一个点速度相同的两个人.永远都是不可能.所以你要处理出来所有速度最大的点,然后用他们构成一个凸包,你把端点的点求出来了,还得判断一下在边上的情况.然后顶点和在边上的点所构成的就是可以到达无穷远处的人. PS:抄了芳姐的模版..哈哈哈 Area of Mushroom Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/

HDU 4569 Special equations(数学推论)

题目 //想不出来,看了解题报告 /* 题意:给你一个最高幂为4的一元多项式,让你求出一个x使其结果模p*p为0. 题解:f(x)%(p*p)=0那么一定有f(x)%p=0,f(x)%p=0那么一定有f(x+p)%p=0. 所以我们可以开始从0到p枚举x,当f(x)%p=0,然后再从x到p*p枚举,不过每次都是+p,找到了输出即可,没有的话No solution! */ #include<stdio.h> int main() { int t,n; __int64 a[5],p; scanf(

HDU 1019 Least Common Multiple 数学题解

求一组数据的最小公倍数. 先求公约数在求公倍数,利用公倍数,连续求所有数的公倍数就可以了. #include <stdio.h> int GCD(int a, int b) { return b? GCD(b, a%b) : a; } inline int LCM(int a, int b) { return a / GCD(a, b) * b; } int main() { int T, m, a, b; scanf("%d", &T); while (T--)

2014多校联合八(HDU 4945 HDU 4946 HDU 4948 HDU 4950 HDU 4951 HDU 4952)

HDU 4945 2048 题意:给你一堆数字  问有几个子集可以拼出2048 思路: 拼数字的规则相当于让数字乘二  所以不是2^i的数字不会拼出2048  那么这些数可选可不选  即为2^cnt种可能 之后只要计算出有几个子集不可能拼出2048即可  不过简单的直接dp是2048*100000的复杂度的  会TLE 所以要变成先枚举元素  再枚举该种元素个数  再枚举2048种状态  然后利用组合求(组合里需要逆元) 为什么这样快?  因为比如枚举2^5这个元素的时候  最多取2^6个  枚

hdu 1577 WisKey的眼神 (数学几何)

WisKey的眼神 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2059    Accepted Submission(s): 625 Problem Description WisKey的眼镜有500多度,所以眼神不大好,而且他有个习惯,就是走路喜欢看着地(不是为了拣钱哦^_^),所以大家下次碰见他的时候最好主动打下招呼,呵呵.但是