Title: Here
Test instructions: The smooth horizontal line has n mass equal ball, known the initial position of each ball, the initial velocity and direction, each moment of each ball of acceleration A is satisfied a*v=c,v is the speed of the moment, C is known
Constant, the collision between the balls is a complete collision (do not understand on Baidu), and then Q asks, each time the T-second time the speed of the small ball speed is how much?
Complete collision is the speed of the exchange after the collision, speed or the two speed, but not the original ball, but this does not need to consider, because only need to care about the speed, so the initial direction and the initial position and so do not need to care about,
Because the acceleration a=c/v, the acceleration is changing all the time, the speed is changing all the time, and it is not uniform change, so because the acceleration a=dv/dt=c/v==>dt/dv=v/c==>t=v^2/(2*c)-v0 (initial velocity) ^2/(2*c)
V=sqrt (V0*v0+2*t*c), by this formula can know the initial speed of the size of the order of the speed after T-second, the size of the order remains unchanged, now is the number of T-second after the number is still the number of the largest.
1#include <cstdio>2#include <cstring>3#include <iostream>4#include <algorithm>5#include <cmath>6 using namespacestd;7 8 Const intM = 1e5 +Ten;9 DoubleV[m];Ten One intMain () A { - intT,n;DoubleC; -scanf"%d",&t); the while(t--){ -scanf"%D%LF",&n,&c); - for(intI=1; I<=n; i++){ - intx, y; +scanf"%lf%d%d",&v[i],&x,&y); - } +Sort (v+1, v+n+1); A intQ; atscanf"%d",&q); - while(q--){ - intKDoubleti; -scanf"%lf%d",&ti,&k); -printf"%.3lf\n", sqrt (v[k]*v[k]+2*ti*c)); - } in } - return 0; to}
HDU 5826 (Physical) physics