1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 11:08:15 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/阶乘函数后 K 个零 [preimage-size-of-factorial-zeroes-function].html
2022-03-29 12:43:11 +08:00

40 lines
1.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>&nbsp;<code>f(x)</code>&nbsp;&nbsp;<code>x!</code>&nbsp;末尾是 0 的数量。回想一下&nbsp;<code>x! = 1 * 2 * 3 * ... * x</code>,且 <code>0! = 1</code>&nbsp;</p>
<ul>
<li>例如,&nbsp;<code>f(3) = 0</code>&nbsp;,因为 <code>3! = 6</code> 的末尾没有 0 ;而 <code>f(11) = 2</code>&nbsp;,因为 <code>11!= 39916800</code> 末端有 2 个 0 。</li>
</ul>
<p>给定&nbsp;<code>k</code>,找出返回能满足 <code>f(x) = k</code>&nbsp;的非负整数 <code>x</code>&nbsp;的数量。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong><strong> </strong></p>
<pre>
<strong>输入:</strong>k = 0<strong>
输出:</strong>5<strong>
解释:</strong>0!, 1!, 2!, 3!, 和 4!&nbsp;均符合 k = 0 的条件。
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>k = 5
<strong>输出:</strong>0
<strong>解释:</strong>没有匹配到这样的 x!,符合 k = 5 的条件。</pre>
<p><strong>示例 3:</strong></p>
<pre>
<strong>输入:</strong> k = 3
<strong>输出:</strong> 5
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>0 &lt;= k &lt;= 10<sup>9</sup></code></li>
</ul>