HDU-1593 find a way to escape
题意:两个敌人A和B,A在半径为R的湖面中心、B在湖边,A在湖中划船的速率是V1,A和B在湖岸的速率是V2,给定R、V1、V2,判断A到达岸边是否能逃脱B。
思路:挺有意思的一道题、一开始认为A直接朝B的反方向跑,w了,后来才明白首先A要在湖中找到角速度和B相同的同心圆,在同心圆内A的角速度大于B的角速度,同心圆上A、B的角速度相同、然后A直接划往湖边就OK了~ 公式:v=w*r。
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1593
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 #include <cstdio> 2 #include <cmath> 3 #include <cstdlib> 4 #include <cstring> 5 #include <string> 6 #include <algorithm> 7 #include <iostream> 8 using namespace std; 9 #define Pi acos(-1) 10 11 double r,v1,v2; 12 13 int main(){ 14 15 // freopen("data.in","r",stdin); 16 // freopen("data.out","w",stdout); 17 18 while(scanf("%lf%lf%lf",&r,&v1,&v2)!=EOF){ 19 double R=v1*r/v2; // v=w*r 20 if((r-R)/v1<Pi*r/v2) puts("Yes"); 21 else puts("No"); 22 } 23 return 0; 24 }