QOJ.ac

QOJ

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

#10393. 零的个数

الإحصائيات

圣诞老人已经在为 2021 年的圣诞节做准备了。他想购买一定数量的正整数个礼物,以便能够将它们平均分给(没有余数)所有符合条件(非淘气)的孩子。然而,他目前还不知道会有多少个符合条件的孩子——他只知道这个人数在 $a$ 和 $b$ 之间。因此,他想购买最少的正整数个礼物,使得这些礼物能够被 $x \in \{a, a+1, \dots, b\}$ 中的任意数量的孩子平均分配。

他已经计算出了这个(可能非常巨大的)礼物数量,但他不确定计算是否正确,并希望你帮助他进行以下基本的完整性检查。你能告诉他这个数字末尾应该有多少个零吗?

输入格式

输入的第一行也是唯一一行包含两个用空格分隔的整数 $a$ 和 $b$ ($1 \le a \le b \le 10^{18}$)。

输出格式

输出一个整数——圣诞老人需要购买的礼物数量末尾零的个数。

子任务

  • 子任务 1 (6 分):$b \le 16$。
  • 子任务 2 (7 分):$b \le 40$。
  • 子任务 3 (9 分):$a = 1$ 且 $b \le 200$。
  • 子任务 4 (12 分):$b - a \le 10^6$。
  • 子任务 5 (17 分):$a = 1$。
  • 子任务 6 (49 分):无附加限制。

样例

样例输入 1

1 6

样例输出 1

1

样例输入 2

10 11

样例输出 2

1

说明

第一个样例:如果孩子人数在 1 到 6 之间,那么圣诞老人至少需要购买 60 个礼物(因为这是能被 1, 2, 3, 4, 5 和 6 整除的最小数字),数字 60 的末尾有一个零。

第二个样例:如果孩子人数可能是 10 或 11,圣诞老人将购买 110 个礼物。

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
EditorialOpen Official EditorialQingyu- Download

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.