|
|
Show all threads Hide all threads Show all messages Hide all messages | What is output for 10? | Nodir NAZAROV [TUIT-Karshi] | 2052. Physical Education | 17 Dec 2015 02:24 | 3 | There are two ways of re-forming: 1. While replacing, original line must not shift to right or left. In this case the answer is 1 (10 goes after 1, hence only 1 stays in it's place). 2. If original line can shift, then the answer is 8 (numbers from 2 to 9 doesn't move). Both algorithm failed, maybe something is missing in problem statement? What is the answer for 20? 1 or 2 or 3? | Why WA#10? Wrong statement? | Nodir NAZAROV [TUIT-Karshi] | 2052. Physical Education | 10 Dec 2015 02:46 | 2 | I guess input for test #10 is larger than 9. According to my understanding of problem statement, output is always 1 or 2 or 3. The algorithm is pretty straightforward: if all the digits of input except first one, is 9 then print 3. If one among them is 8 and remaining is 9 then print 2, otherwise 1. Any thoughts? I thought Vasya has to stay in his place, maybe that's where it confused me. But now I read statement again and it says "But Vasya found it very boring as he was the first in the line and didn’t have to change his place." |
|
|
|