Hdu 4969 Just a Joke (简单积分)

来源:互联网 发布:台湾人逛淘宝吗 编辑:程序博客网 时间:2024/05/01 22:12

题意:女孩沿圆周做速度v1的匀速圆周运动,男孩从圆心出发追赶女孩,速度v2,保持男孩女孩圆心在一条直线,给出男孩最大移动距离,问能否追上

思路:将男孩的速度分解为径向vx和切向vy,vy=dr/dt,再根据男孩女孩角速度相等,推公式积分即可

#include <cstdio>#include <cstring>#include <cmath>int main (){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\n");elseprintf("Wake up to code\n");}return 0;}


0 0