#P6754. [BalticOI 2013] Palindrome-Free Numbers (Day1)
[BalticOI 2013] Palindrome-Free Numbers (Day1)
Problem Description
We define a palindrome string as a digit string that reads the same forward and backward. If a digit string has a substring of length greater than that is also a palindrome string, then we also define this digit string as a palindrome string.
As the name suggests, a digit string that is not a palindrome string is a palindrome-free string.
Given , find how many digit strings in the interval are palindrome-free strings.
Input Format
One line with two integers representing this interval.
Output Format
One line with one integer representing the answer.
123 321
153
123456789 987654321
167386971
Hint
Constraints
For of the testdata, .
For of the testdata, .
Notes
Translated from BalticOI 2013 Day1 B Palindrome-Free Numbers。
Translated by ChatGPT 5