ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1602. Elevator

What's wrong in calculating total time?
Posted by mai7 2 Mar 2008 03:30
double tt(int x)
{
    double mt=(u*(n-x)>(k-1)*v+15)?u*(n-x):((k-1)*v+15);
    return mt+5.0+(x-1)*v;
}

and after calculation x, that gives the best result, i comparse this to (n-1)*u [situation, when it's optimal to go by foot to first floor].

Edited by author 02.03.2008 04:01

Edited by author 02.03.2008 04:01
Re: What's wrong in calculating total time?
Posted by Zero~BoBo 2 Mar 2008 06:50
Be careful in the precision of Double
Re: What's wrong in calculating total time?
Posted by mai7 3 Mar 2008 03:02
Thanx, I've corrected it