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 1638. Bookworm

Description of the mistake in the format of the sample input
Posted by Bahturin Alexander (SibSUTI) 11 Oct 2008 13:40
The correct format of the input is:
<width of the book w/o the cover>
<width of the cover>
<number of the book where the worm _finishes_>
<number of the book where the worm _starts_>

(so, the last two were just given in the incorrect order)
Re: Description of the mistake in the format of the sample input
Posted by chobits 11 Oct 2008 13:43
really?
Re: Description of the mistake in the format of the sample input
Posted by Ekvilon 11 Oct 2008 14:07
I disagree. Order of input data is absolutely correct.
Re: Description of the mistake in the format of the sample input
Posted by Bahturin Alexander (SibSUTI) 11 Oct 2008 16:30
So whould you mind explaining me the 'Sample output'?
I treated the input as I wrote above and got AC..
Re: Description of the mistake in the format of the sample input
Posted by spNautilus 11 Oct 2008 17:23
I did as he told and got AC, too.
Re: Description of the mistake in the format of the sample input
You are wrong, guys. Input format is correct. You're lucky that ACed the problem without thinking about it. Think - and you'll find out that input specification is indeed correct - it's a very famous logical puzzle =)
Re: Description of the mistake in the format of the sample input
Posted by Anisimov Dmitry (Novosibirsk STU) 12 Oct 2008 20:11
The input format is entirely correct.
The problem requires knowledge about how REAL books are USUALLY placed on shelves.
The problem is very old trick really. I am sure many of contestants were already familiar with it (I was).

Edited by author 12.10.2008 20:12

Edited by author 12.10.2008 20:12
Re: Description of the mistake in the format of the sample input
Posted by Bahturin Alexander (SibSUTI) 14 Oct 2008 00:26
So.. Do you (all of you who says that input format is correct) mean that books are stored in a way that the last page is the leftmost one? If so than it's not surprising that the solution which swaps numbers of the books gets AC.
Re: Description of the mistake in the format of the sample input
Posted by Dr Zhihua Lai 29 Aug 2011 17:05
yes, just imagine.
when you place books on the shelf, the books are facing inwards, which means, the first page is on the right and the last page is on the left.
Re: Description of the mistake in the format of the sample input
Posted by Bogatyr 15 Oct 2012 22:34
Hah, I wasn't familiar with this particular trick, but I've done enough of the "simple" problems on Timus now to know that many problems derive their difficulty not from the underlying algorithm, but in correctly understanding problem statements which are sometimes tricky, ambiguous, or rely on unstated assumptions (like this one, assuming how people "normally" put books on shelves, and which side of the book contains the first page).

So I'm learning to always ask "what's the catch?" and got AC first time on this one (after initial WA on many other "simple" problems).   So solving Timus problems is successfully training me to read problems very carefully!
Re: Description of the mistake in the format of the sample input
Posted by BillSu 27 Apr 2014 13:04
If you are really smart, try the problems not one get AC before, otherwise get the hell out of your pretentious mask.