Help Problem A div 1, #364

Revision en7, by CazadorDivino, 2016-07-24 03:43:54

In this problem, what is the meaning of "as well as the reversal of the bus, take place immediately and this time can be neglected." in this problem. I can two possibilities. 1, back the bus to collect pupils does not last any (immediate). 2, turn the car back nothing lasts for (immediate), but the movement to pick up a pupil (bakc) is counted in time.

Thanks for clearing my doubt.

I'm trying to understand the problem's solution.

int main() {
    int n, k;
    D l, v1, v2;
    cin >> n >> l >> v1 >> v2 >> k;
    
    
    int b = (n + k - 1) / k;
    cout<< "("<< n<< "+"<< k <<"- 1)"<< "/"<< k<< "= "<< b<< endl;
    double den = (2 * (b - 1) * v1 / (v1 + v2)) + 1;
    cout<<"(2 * ("<<b <<"- 1) * "<<v1 <<"/ ("<<v1 <<"+"<< v2<<")) +"<< 1 << "=" << den<<endl;
    double x = l / den;
    cout<< l <<"/ "<<den<<"="<< x<< endl;
    double ans = x / v2 + (l - x) / v1;
    cout<< x <<"/"<< v2 <<"+" <<"("<<l <<"-"<< x<<") / "<<v1 << "="<< ans<< endl;
    printf("%0.9f\n", ans);
    return 0;
}
Tags math, #364

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en7 English CazadorDivino 2016-07-24 03:43:54 23
en6 English CazadorDivino 2016-07-24 03:42:48 1 Tiny change: 'eglected._ " in this ' -> 'eglected._" in this '
en5 English CazadorDivino 2016-07-24 03:41:23 5
en4 English CazadorDivino 2016-07-24 03:40:44 4
en3 English CazadorDivino 2016-07-24 03:40:11 997
en2 English CazadorDivino 2016-07-24 02:33:31 3
en1 English CazadorDivino 2016-07-24 02:33:13 515 Initial revision (published)