P27841 [洛谷] [Information and Future 2022] Lucky Numbers
普及-
题目描述

Problem Description

If a decimal number, when read from left to right, has all its digits in strictly increasing order, we call it a lucky number. For example:

  • $9$, $27$, $1234$ are lucky numbers;
  • $11$, $80$, $243$, $1503$ are not lucky numbers.

For given integers $a$ and $b$, please count the number of lucky numbers in the range $a, a+1, a+2, \cdots, b$.

Input Format

Input consists of a single line containing two space-separated integers $a$ and $b$.

Output Format

Output a single integer representing the number of lucky numbers in the range $a, a+1, a+2, \cdots, b$.

Sample Input and Output

Sample Input #1

1 100

Sample Output #1

45

Sample Input #2

4096 65536

Sample Output #2

141

Notes

For $100\%$ of the data, it is guaranteed that $1 \leq a \leq b \leq 1,000,000$.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
1 100
样例输出
45