QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 32 MB Puntuación total: 10

#10386. 双阶乘 [B]

Estadísticas

对于一个正整数 $n$,其阶乘定义为从 1 到 $n$ 的所有整数的乘积,记作 $n!$。现在,$n$ 的双阶乘定义为 1 的阶乘、2 的阶乘,一直到 $n$ 的阶乘的乘积:$1! \cdot 2! \cdot 3! \cdot \ldots \cdot n!$。给定 $n$,求 $n$ 的双阶乘的十进制表示末尾有多少个零。

输入格式

标准输入的第一行也是唯一一行包含一个整数 $n$ ($1 \le n \le 10^{18}$)。

输出格式

标准输出的第一行也是唯一一行应包含 $n$ 的双阶乘末尾零的个数。

样例

输入 1

11

输出 1

9

说明

11 的双阶乘等于 265 790 267 296 391 946 810 949 632 000 000 000。该数字末尾有 9 个零。

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.