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 1379. Cups Transportation

For those who gets WA #2 AND ADMINS!
Posted by it4.kp 22 Jul 2006 20:05
This code:
...
int l=0, h=10000000, mid;
while (l+1<h) {
  mid=(l+h)/2;
  if (can(mid))l=mid; else h=mid;
}
...
gets WA #2

but this one:
...
int l=0, h=10000001, mid;
while (l+1<h) {
  mid=(l+h)/2;
  if (can(mid))l=mid; else h=mid;
}
...

gets AC! Feel the diference!

TO ADMINS:
Problem statement says road capacity < 10^9, so we'll never be able to deliver 10^7 cups, since truck weights 3*10^6 grammes. But obviously answer on TEST #2 is 10^7. Fix it, please.
You are obviously wrong (+)
Posted by Dmitry 'Diman_YES' Kovalioff 22 Jul 2006 20:51
There is no number in the input files that exceeds 10^9. The tests are absolutely correct. The answer for the second test is 10^7. But it is possible when N=1.

P.S. It is a common mistake. Always test your program on boundary tests.
Re: You are obviously wrong (+)
Posted by it4.kp 23 Jul 2006 05:36
Well, technically you are right. But let's take a look at the problem statement... First, we can see phrase:

"Of course, it is impossible to deliver 10000000 cups (this is the amount of cups ordered by organizing committee) in a ONE trip."

And then the output format:

"Print the only number: the total amount of the cups (it must be as much as possible), which can be delivered in the FIRST trip of the truck in a time of 24 hours."

After that I don't think answer 10^7 is full of sense.

And why to write all that story with delivering cups if N=1?

IMO problem statement should not be tricky.