QOJ.ac

QOJ

Time Limit: 8 s Memory Limit: 512 MB Total points: 10

#1377. Potyczkowa 数

Statistics

Bajtek 在数学史课上了解到了俄罗斯数学家 Władimir Potyczko。这位著名的学者因描述了一类数字而闻名,今天我们为了纪念他,将这类数字称为“Potyczkowa 数”。

Potyczkowa 数被定义为任何能够被其十进制表示中的每一位数字整除的正整数。特别地,这意味着这类数字的十进制表示中不能包含数字 0。例如,48、1 和 112 是 Potyczkowa 数,而 23、10 和 121 则不是。

Bajtek 想知道有多少个 Potyczkowa 数。他很想知道在区间 $[l, r]$ 中有多少个这样的数字。请帮他计算一下!

输入格式

标准输入的一行包含两个整数 $l$ 和 $r$ ($1 \le l \le r < 10^{18}$)。

输出格式

输出一个整数,表示区间 $[l, r]$ 中 Potyczkowa 数的个数。

样例

输入 1

1 100

输出 1

23

说明 1

不大于 100 的 Potyczkowa 数有:1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 22, 24, 33, 36, 44, 48, 55, 66, 77, 88 和 99。

子任务

在部分测试点中,满足 $r - l \le 10^6$。

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.