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 2023. Donald is a postman

Nodir NAZAROV Komilijonovich [TUIT-Karshi] Little trick: if you are getting W3, or W5 or whatever [2] // Problem 2023. Donald is a postman 5 Dec 2014 02:50
use simple algorithm:
 - checks only initial.
 - keep state of previous
 - initial state of previous is 1, since postman is in leftmost case

useful test cases:

----
1
Bambi

1 (not 0, because he moves to second case with one step)
----
1
Alice

0
----
1 Dumbo

2
---
WA 5, but test is true( sorry, because I don't know English:)
Didn't get your testcase; if Bambi, Alice and Dumbo are the Kids, the answer should be 3, right?