Two digits
How many n-digit numbers can be created using only digits 5 and 9, where no three identical digits stand side by side?
Specifications
Input
One number n (n ≤ 30).
Output
The amount of n-digit numbers.
Problem information
Time Limit: 1.3 secondsMemory Limit: 64 MB
Balls for the passed test: 10
Complexity: 19% 361/448
Classes: Dynamic programming
Example
Example input3 |
Example output6 |
| ← Prison escape | Problems | Long number (RU) → |
