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

WA #11
Posted by Russtam 10 Apr 2008 15:58
What's wrong with my function?
long double f(int x)
{
 if (x>1)
 {
   long double t;
   if (((k-1)*v+15)>((n-x)*u))
     t=(k-1)*v+15;
   else
     t=(n-x)*u;
   return t+(x-1)*v+5+(x-1)*v;
 }
 else
 {
   return (n-1)*u;
 }
}
People give me some tests.

Edited by author 10.04.2008 19:46
Re: WA #11
Posted by black 6 Jul 2008 02:25
Your source is right. But please don't remember that "If there are several equivalent variants, output such one in which Petr will go by foot the smaller distance."