HDU 1593 find a way to escape
来源:互联网 发布:宋仲基宋慧乔婚礼知乎 编辑:程序博客网 时间:2024/05/01 16:43
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1593
解析:
题意:两个敌人A和B,A在半径为R的湖面中心、B在湖边,A在湖中划船的速率是V1,A和B在湖岸的速率是V2,给定R、V1、V2,判断A到达岸边是否能逃脱B。
思路:挺有意思的一道题、一开始认为A直接朝B的反方向跑,WA了,后来才明白首先A要在湖中找到角速度和B相同的同心圆,在同心圆内A的角速度大于B的角速度,同心圆上A、B的角速度相同、然后A直接划往湖边就OK了~ 公式:v=w*r。
代码:
/*ID:muller8Name: 1593 find a way to escapeReference: 数学*/#include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <algorithm>#include <vector>#include <cmath>using namespace std;#define MAXN 100005#define INF 1e9#define PI 3.141592653int main(){ int R,V1,V2; while(~scanf("%d%d%d", &R,&V1,&V2)){ double r = (V1*R)/(1.0*V2); double time1, time2; time1 = (R-r)/(1.0*V1); time2 = (PI*R)/V2; if(time1 < time2) printf("Yes\n"); else printf("No\n"); } return 0;}
0 0
- hdu 1593 find a way to escape
- HDU 1593 find a way to escape
- hdu 1593 find a way to escape
- hdu 1593 find a way to escape
- HDU 1593 find a way to escape
- hdu 1593 find a way to escape
- HDU 1593 find a way to escape
- HDU 1593: find a way to escape
- HDU 1593 find a way to escape
- hdu find a way to escape(1593)
- hdu 1593 find a way to escape
- HDU 1593 find a way to escape
- HDU 1593 find a way to escape
- hdu Find a way to escape (几何)
- HDU 1593 - find a way to escape(思维)
- HDU 1593 find a way to escape(角速度)
- find a way to escape(1593)
- find a way to escape
- axis2调用服务的url
- linux 查找头文件
- 最完整的 9 种常用排序算法 c++ 模板实现
- 多例模式
- 组合数据的输出
- HDU 1593 find a way to escape
- 在Mac上安装Ruby on Rails
- poj-2750
- LA 3211 Now or Later(2-SAT问题)
- ID3算法 改进的C4.5算法 决策树算法
- 方格取数
- iOS7—图像资源Images Assets
- Html中的过滤器的相关操作
- 全景探秘游戏设计艺术 笔记