Palindrome-Free Numbers
시간 제한: 1000ms메모리 제한: 128MB출처: BOI 2013BOJ 6289
문제
A string is a palindrome if it remains the same when it is read backwards. A number is palindrome-free if it does not contain a palindrome with a length greater than 1 as a substring. For example, the number 16276 is palindrome-free whereas the number 17276 is not because it contains the palindrome 727.
Your task is to calculate the total number of palindrome-free numbers in a given range.
입력
The input contains two integers, a and b. (0 ≤ a ≤ b ≤ 1018)
출력
The output should contain one integer: the total number of palindrome-free numbers in the range a, ..., b (including a and b).
예제
예제 1
입력
123 321
출력
153
코드를 제출하려면 로그인하세요.