QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 128 MB مجموع النقاط: 100

#15582. Palindrome-Free Numbers

الإحصائيات

如果一个字符串正着读和倒着读是一样的,那么它就是一个回文。如果一个数字不包含任何长度大于 $1$ 的回文子串,则称该数字是无回文数。例如,数字 $16276$ 是无回文数,而数字 $17276$ 则不是,因为它包含了回文子串 $727$。

你的任务是计算给定区间内无回文数的总数。

输入格式

输入包含两个整数 $a$ 和 $b$。

输出格式

输出应包含一个整数:区间 $[a, b]$(包含 $a$ 和 $b$)内无回文数的总数。

数据范围

$0 \le a \le b \le 10^{18}$

对于占 $25$ 分的测试用例:$b - a \le 100\,000$。

样例

输入样例 1

123 321

输出样例 1

153

输入样例 2

123456789 987654321

输出样例 2

167386971

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.