find a way to escape--hdu1593
题目链接 :
http://acm.hdu.edu.cn/showproblem.php?pid=1593
找到二者角速度相等时水中人的R,在此之前二者保持在一条直线上,之后水中的人沿直线到岸边S点匀速运动,岸上的人也匀速圆周运动到S点;
1 #include<stdio.h> 2 #include<iostream> 3 #include<algorithm> 4 #include<string.h> 5 #include<math.h> 6 #define N 1100 7 #define PI 4*atan(1) 8 using namespace std; 9 10 int main() 11 { 12 int r,v1,v2; 13 double t1,t2,R; 14 while(scanf("%d %d %d",&r,&v1,&v2)!=EOF) 15 { 16 R=v1*r*1.0/v2; 17 t1=(r-R)/v1; 18 t2=PI*r*1.0/v2; 19 if(t1<t2) 20 printf("Yes\n"); 21 else 22 printf("No\n"); 23 } 24 return 0; 25 }
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步