시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 512 MB | 35 | 13 | 12 | 38.710% |
Define a rainbow number as an integer that, when represented in base $10$ with no leading zeros, has no two adjacent digits the same.
Given lower and upper bounds, count the number of rainbow numbers between them (inclusive).
The first line of input contains a single integer $L$ ($1 \le L < 10^{10^5}$), which is the lower bound.
The second line of input contains a single integer $U$ ($1 \le U < 10^{10^5}$), which is the upper bound.
It is guaranteed that $L \le U$. Note that the limits are not a misprint; $L$ and $U$ can be up to $10^5$ digits long.
Output a single integer, which is the number of rainbow numbers between $L$ and $U$ (inclusive). Because this number may be very large, output it modulo $998,244,353$.
1 10
10
12345 65432
35882
ICPC > Regionals > North America > Southeast USA Regional > 2020 Southeast USA Regional Programming Contest L번
ICPC > Regionals > North America > Mid-Central Regional > 2020 Mid-Central Regional Programming Contest D번
ICPC > Regionals > North America > Pacific Northwest Regional > 2020 ICPC Pacific Northwest Region > Division 1 O번
ICPC > Regionals > North America > Pacific Northwest Regional > 2020 ICPC Pacific Northwest Region > Division 2 AF번
ICPC > Regionals > North America > South Central USA Regional > 2020 South Central USA Regional Contest L번