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
");
21         else
22             printf("No
");
23     }
24     return 0;
25 }
原文地址:https://www.cnblogs.com/zhengguiping--9876/p/4427315.html