P28644 [洛谷] SAC#1 - Cute Numbers
提高+
题目描述

Problem Background

This problem is provided by the world's most novice SOL.

The Jiyuecheng website is the official site of the Perfect Information Classroom. Address: http://191.101.11.174/mgzd.

Problem Description

Novice SOL finds numbers cute!

Fortunately, not all numbers are cute in his eyes. Only numbers that "have a palindromic substring of at least length 2" are considered cute. For example, $101$ is cute because $101$ itself is a palindromic number; $110$ is cute because it includes the palindromic substring $11$; but $102$ is not cute, and $1201$ is not cute either.

Now SOL wants to know how many cute numbers there are among all integers from $l$ to $r$.

Since the answer could be very large, output the answer modulo $1000000007$ ($10^9+7$).

Input Format

The input contains only one line with two integers: $l$ and $r$.

Output Format

The output contains only one line with one integer, which is the answer.

Sample Input and Output

Sample Input #1

1 100

Sample Output #1

10

Sample Input #2

100 1000

Sample Output #2

253

Notes

Let $n$ be the number of digits of $r$ in base 10.

For $10\%$ of the data, $n \le 3$.

For $30\%$ of the data, $n \le 6$.

For $60\%$ of the data, $n \le 9$.

For all the data, $n \le 1000$, $l < r$.


2024/2/4 Added a set of hack data.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
1 100
样例输出
10