Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
Hint | So Sui Ming | 1638. Книжный червь | 9 дек 2023 09:54 | 1 |
Hint So Sui Ming 9 дек 2023 09:54 It seems that the worm always starts at back cover and ends at front cover and order of volumes matters. |
Is this consideration right? | Humoyun Ahmedov | 1638. Книжный червь | 2 дек 2023 21:23 | 2 |
1 10 1 2 -> 2: means books are placed upside down, in this case first sheet of the first book is adjacent to the second book 1 10 2 1 -> 22: means books are placed correctly, last sheet of the first book is adjacent to the second book Edited by author 10.11.2015 07:42 |
Sample test | A.Z | 1638. Книжный червь | 11 июл 2022 16:18 | 13 |
Why output is 2 , I think it should be 22 , because the worm started from the first sheet of vol 1 and goes until last sheet of vol 2 . so it's path is 10+1+1+10 = 22 if "NO COMMENTS" why you write this? information - Zero You should know, that answer "No comments" is identical to "Read the problem statement" You could have written explanation or something instead of writing no comments. Its like making fun of the guy, like jewish do. Try to put two books in a bookshelf, and see the reason for no comments :D what answer will be for test like this: 10 1 3 1 zero? >what answer will be for test like this: >10 1 3 1 Answer is 34. No for the case 10 1 3 1 Answer is 12 No for the case 10 1 3 1 Answer is 12 No. You are wrong. My ACed solusion also gave 34. Even if you solve it by hand it is the same result. Because books are [from first ][][ to last] There are 4 symbols of [ and ] that are book covers. So, three books and 4 covers of the books that worm had gnawed. You seem to be an anti-Semite! Jewish are not guilty of your stupidity Are there no moderators here? Hateful comments should be instantly removed and the idiots who post them should be temporarily or permanently banned! Think of the reputation of this otherwise great site! Ok, the problem statement doesn't clarify that this book is an LTR language (left to right, e.g. English) book.Shuch a crucial info shouldn't be left to the assumptions of the reader. |
Unclear statement. | Ajay Jadhav | 1638. Книжный червь | 2 май 2021 11:14 | 1 |
If you put two books on a bookshelf by facing binding side (book number) outwards i.e facing person, then this problem statement makes sense. |
It’s a very practical problem. | Sultana Razia | 1638. Книжный червь | 6 окт 2020 07:08 | 1 |
I did not understand this problem firstly .But after 3rd trial i get amused!. |
Interesting Problem it is...! | ইলহাম আল মুসাব্বির | 1638. Книжный червь | 6 окт 2020 07:04 | 2 |
Read the problem statement carefully. Its a very realistic,practical and easy problem. Draw a picture to help yourself for finding the solution. Keep in mind that the worm will move leftwards or rightwards from its initial position according to input of starting volume and ending volume. It is also possible that the worm started and ended in the same volume... Happy Coding...:) First i did not understand this problem.but your suggestions help me.thanks!!!And it is really very practical, realistic and easy problem!! |
I can't understand the problem's statement | Bahturin Alexander (SibSUTI) | 1638. Книжный червь | 5 окт 2020 18:46 | 6 |
If the worm starts from the first sheet of the first volume and finishes at the last one of the second volume, how could the answer for the sample input be 2, given that the thikness of the book (not including the cover) is 10? Worm can move both left and right. Stop for a while and think about it. In some languages, the "first page" of a book is on the left side of the book when the book is placed on a shelf. In which case "10 1 1 2" == 22. Just take two books and try - you will find answer immediately I fully agree with you.How could the answer for sample input be 2. |
WHY WA 5 | JAVATO | 1638. Книжный червь | 11 ноя 2019 10:35 | 7 |
I'm also getting WA5. Please help. try this tests: 1)in: 10 1 2 1 ans: 22 2)in: 10 1 1 1 ans: 10 thank you very much:)))))))))))))))))))))))))))))))))))))))))))))))))))))) |
Description of the mistake in the format of the sample input | Bahturin Alexander (SibSUTI) | 1638. Книжный червь | 27 апр 2014 13:04 | 11 |
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) I disagree. Order of input data is absolutely correct. So whould you mind explaining me the 'Sample output'? I treated the input as I wrote above and got AC.. I did as he told and got AC, too. 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 =) 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 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. 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. 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! If you are really smart, try the problems not one get AC before, otherwise get the hell out of your pretentious mask. |
Could someone please kindly explain the example solution provided. | Anupam Ghosh, Wipro Technologies | 1638. Книжный червь | 15 окт 2012 22:37 | 2 |
Apologies, since I started this thread. Understood the problem got AC. when I placed two books on shelf side by side I understood the problem. Thanks to all memebers who posted in other threads. Regards Anupam Edited by author 11.03.2012 02:41 The problem relies on the unstated assumption of how people "normally" put books on shelves, and assumes that the pages in the book are arranged like books in Western languages. |
Тест 1 почему не работает ????!!! | AndreyKopchuk | 1638. Книжный червь | 4 июн 2012 19:01 | 3 |
Здравствуйте. Ни как не могу понять что тут не правильно. Помогите пожалуйста. #include <conio.h> #include <stdio.h> #include <iostream> #include <fstream> using namespace std;
int main(){ int p, a,b,c,d,i; long long cur; cin >>a; cin >>b; cin >>c; cin >>d; cur = 0; if ( d > c){ p = d - c+ 1; cur = a*p; cur = cur + b*(p*2 - 2); cout << cur; return 0; } if ( c < d){ p = c - d + 1; cur = b*(p*2 - 2); cur = cur + a * (p - 2); cout << cur; return 0; } } И почему в условном тесте ошибка? Там 22 должно быть а не 2. в тесте все правильно просто первая страница справа, а последняя слева... ну сами подумайте.. когда вы ставите книгу на полку корешком к себе, получается что она переворачивается :) Теперь понятно. Спасибо большое. Edited by author 04.06.2012 19:02 Edited by author 04.06.2012 19:02 |
Test please | Nikita Sivukhin | 1638. Книжный червь | 29 апр 2012 18:16 | 3 |
не могу подобрать тест определяющий ошибку.... Thank you for your prompt response)))) |
WA 10 | rakeshvarna | 1638. Книжный червь | 21 апр 2012 00:35 | 3 |
WA 10 rakeshvarna 24 ноя 2008 23:16 wht am i missing here? #include<stdio.h> int main() { int th,co,n1,n2,z; long s; scanf("%d %d %d %d",&th,&co,&n1,&n2); if(n2>n1) { z=n2-n1; s=2*z*co+((z-1)*th); } else { z=n1-n2; s=((2*z)+1)*co+(z+1)*th-1; } printf("%ld\n",s); return 0; } |
Why WA#9? | Kernel | 1638. Книжный червь | 21 апр 2012 00:35 | 2 |
|
This problem is really fun! | MinqiPan | 1638. Книжный червь | 21 апр 2012 00:34 | 3 |
i can't help my self saying this |
test 10 -help!!! | Nargiza Asqarova | 1638. Книжный червь | 7 дек 2011 16:42 | 3 |
var t,z,k:byte; a,b:1..100; s:longint; begin read(t,z,a,b); if (b>a) then begin k:=b-a; s:=2*k*z+((k-1)*t); end; if(a>b) then begin k:=a-b; s:=(((2*k)+1)*z+(k+1)*t-1); end; write(s);end. tushunarli qip o'zbechasini yozin |
solution The are three formules | Michail Yudin | 1638. Книжный червь | 6 сен 2011 23:47 | 4 |
when first book = last book, when first book < last book and when last book < first book. 5 minutes to got it. its very simple; solution at o(1); AC 0,015 In fact we can solve it without if, just one (!) formula: abs( ( n2 - n1 ) * ( l1 + 2 * l2 ) - l1 ) 8-) :D easy :D only 1 formul is needed i did same as dAFTc0d3r [Yaroslavl SU] :) |
Do you wanna know what is WA5? | Hikmat | 1638. Книжный червь | 20 авг 2011 14:56 | 1 |
Answer: Start Volume Number > Stop Volume Number You assume that worm start at lower volume and stops at higher volume but DO NOT. Here is a code in C#: using System; class Program { static void Main() { string[] ss = Console.ReadLine().Split(new char[] { ' ', '\t', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); int Thickness = int.Parse(ss[0]); int CoverThickness = int.Parse(ss[1]); int Start = int.Parse(ss[2]); int Finish = int.Parse(ss[3]); int route = Math.Abs((Finish - Start - 1) * (Thickness + 2 * CoverThickness) + 2 * CoverThickness); Console.WriteLine(route); } } |
hint | Aydar | 1638. Книжный червь | 15 авг 2011 20:00 | 3 |
hint Aydar 15 авг 2011 15:03 i cant understand! help me Re: hint daftcoder [Yaroslavl SU] 15 авг 2011 20:00 Don't create new topics, just watch the problem's discussion. |
Why 2 | MYV | 1638. Книжный червь | 7 авг 2011 05:20 | 11 |
Why 2 MYV 11 окт 2008 13:25 Почему в примере ответ 2 ? Непонимаю условия! Please post in english , It was my problem too!! I want to know the answer А я знаю. Последний лист книги слева а первый справа. Like yeah, the books _are_ on the bookshelf. i want to know,too Edited by author 11.10.2008 13:48 because the front-cover of the i_th book is next to the back-cover of the (i+1)_th book Re: Why 2 Siroj Matchanov [TUIT] 28 июл 2011 01:04 Hint: Imagine the books mounted on the bookshelf... |