---------10.26
The CF is rolling again--
It's too stupid to be rough------
All Right--->_<
CF 591 D
Http://codeforces.com/problemset/problem/591/D
Look at the stick inside the puzzle, said is to change the reference system, the starting point as fixed, and then two minutes
Later wrote the next unchanged reference system, also can
There should be no difference,,,
1#include <cstdio>2#include <cstring>3#include <iostream>4#include <algorithm>5#include <vector>6 using namespacestd;7 8 intx1,y1,x2,y2,v,t;9 intVx,vy,wx,wy;Ten Const intINF = (1<< -)-1; One A intOkDoublex) { - DoubleX3,y3; - if(x <=T) { thex3 =1.0*x1 + x*VX; -Y3 =1.0*y1 + x*vy; - } - if(X >T) { +x3 =1.0*x1 + T*VX + (x-t) *WX; -Y3 =1.0*y1 + T*vy + (x-t) *WY; + } A Doubledis = (x3-x2) * (X3-X2) *1.0+ (y3-y2) * (y3-y2) *1.0; at returnDis >= v*v*x*x*1.0; - } - - voidsolve () { - DoubleL =0.0, r =1.0*Inf,mid; - for(inti =0; I <= +; i++){ inMid = (l+r) *0.5; - if(OK (mid)) L =mid; to ElseR =mid; + - //printf ("L =%lf r =%lf mid =%lf\n", l,r,mid); the } *printf"%.16lf\n", L); $ } Panax Notoginseng - intMain () { the while(SCANF ("%d%d", &x1,&y1)! =EOF) { +scanf"%d%d",&x2,&y2); Ascanf"%d%d",&v,&T); thescanf"%d%d",&vx,&vy); +scanf"%d%d",&wx,&WY); - $ solve (); $ - } - return 0; the}
View Code
Nineth Week 10.26---11.1