QOJ.ac

QOJ

実行時間制限: 1 s メモリ制限: 2048 MB 満点: 100

#1372. 彩虹数字

統計

定义“彩虹数”(rainbow number)为一个整数,当它以十进制表示且无前导零时,没有两个相邻的数字相同。

给定下界和上界,计算它们之间(包含边界)的彩虹数个数。

输入格式

第一行包含一个整数 $L$ ($1 \le L < 10^{10^5}$),表示下界。 第二行包含一个整数 $U$ ($1 \le U < 10^{10^5}$),表示上界。

保证 $L \le U$。注意,这些限制并非笔误;$L$ 和 $U$ 最多可达 $10^5$ 位长。

输出格式

输出一个整数,表示 $L$ 和 $U$ 之间(包含边界)的彩虹数个数。由于该数字可能非常大,请将其对 $998,244,353$ 取模后输出。

样例

样例输入 1

1
10

样例输出 1

10

样例输入 2

12345
65432

样例输出 2

35882

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.