cf590B Chip 'n Dale Rescue Rangers
2015-11-01 00:19
405 查看
B. Chip 'n Dale Rescue Rangers
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
A team of furry rescue rangers was sitting idle in their hollow tree when suddenly they received a signal of distress. In a few moments they were ready, and the dirigible of the rescue chipmunks hit the road.
We assume that the action takes place on a Cartesian plane. The headquarters of the rescuers is located at point (x1, y1), and the distress signal came from the point (x2, y2).
Due to Gadget's engineering talent, the rescuers' dirigible can instantly change its current velocity and direction of movement at any moment and as many times as needed. The only limitation is: the speed of the aircraft relative to the air can not exceed
cf590B
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
A team of furry rescue rangers was sitting idle in their hollow tree when suddenly they received a signal of distress. In a few moments they were ready, and the dirigible of the rescue chipmunks hit the road.
We assume that the action takes place on a Cartesian plane. The headquarters of the rescuers is located at point (x1, y1), and the distress signal came from the point (x2, y2).
Due to Gadget's engineering talent, the rescuers' dirigible can instantly change its current velocity and direction of movement at any moment and as many times as needed. The only limitation is: the speed of the aircraft relative to the air can not exceed
#include<set> #include<map> #include<ctime> #include<deque> #include<queue> #include<bitset> #include<cstdio> #include<cstdlib> #include<cstring> #include<iostream> #include<algorithm> #define LL long long #define inf 0x7fffffff #define pa pair<int,int> #define pi 3.1415926535897932384626433832795028841971 #define eps 1e-8 using namespace std; inline LL read() { LL x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f; } double x1,x2,y1,y2,x,y,l,r,ans,vm,t,sumx,sumy; int tot; inline bool jud(double mid) { sumx=x;sumy=y; if (mid<=t)sumx-=mid*x1,sumy-=mid*y1; else sumx-=t*x1+(mid-t)*x2,sumy-=t*y1+(mid-t)*y2; return mid*mid*vm*vm>=sumx*sumx+sumy*sumy; } int main() { scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);x=x2-x1;y=y2-y1; scanf("%lf%lf",&vm,&t); scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2); tot--; l=0;r=100000000; while (l+eps<r) { double mid=(l+r)/2; if(jud(mid)){ans=mid;r=mid;} else l=mid; } printf("%.7lf\n",ans); return 0; }
cf590B
相关文章推荐
- EQueue 2.0 性能测试报告
- cf591A Wizards' Duel
- public final Cursor query ()参数解析
- LightOJ - 1061 N Queen Again(状压DP)
- [Django与表单]request.META里包含了哪些数据?
- 02-使用C3P0连接池连接MySql并且使用QueryRunner简化数据库操作
- LightOJ - 1126 Building Twin Towers(DP)
- 一、WIN7下EasyUI环境IIS配置支持.json格式的文件
- CodeForces 589H Tourist Guide(树形DP)
- [IR课程笔记]Query Refinement and Relevance Feedback
- CodeForces 589F Gourmet and Banquet(二分 + 最大流)
- Quartz 2D学习(三)自定义圆角按钮
- 编写函数返回值value的二进制模式从左到右翻转后的值
- Gradle Plugin User Guide
- wpf之IValueConverter接口
- UITextField和UIButton属性
- UITableViewCell加载时的简单动画效果
- UICollectionView 单选的实现
- iOS--UITextFiled的使用方法
- iOS--UIButton的使用方法