Computer Transformation
Time limit1sMemory limit128 MB
Given n up to 1000, compute the count of adjacent
- Level
Medium6 of 10
- Topics
- Math, String, Dynamic programming
- Solved
- No attempts yet
Problem
A computer starts with a sequence consisting of a single digit: the number . At each time step, the computer simultaneously replaces every digit with the sequence and every digit with the sequence .
Thus after the first step the sequence is ; after the second step it is ; after the third step it is ; and so on.
How many pairs of consecutive zeroes appear in the sequence after steps?
Input
Each input line contains one natural number (). Process every line until the end of input.
Output
For each , print on its own line the number of pairs of consecutive zeroes in the sequence after steps.