mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 19:53:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p> <code>f(x)</code> 是 <code>x!</code> 末尾是 0 的数量。回想一下 <code>x! = 1 * 2 * 3 * ... * x</code>,且 <code>0! = 1</code> 。</p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li>例如, <code>f(3) = 0</code> ,因为 <code>3! = 6</code> 的末尾没有 0 ;而 <code>f(11) = 2</code> ,因为 <code>11!= 39916800</code> 末端有 2 个 0 。</li>
 | 
						||
</ul>
 | 
						||
 | 
						||
<p>给定 <code>k</code>,找出返回能满足 <code>f(x) = k</code> 的非负整数 <code>x</code> 的数量。</p>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>示例 1:</strong><strong> </strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong>k = 0<strong>
 | 
						||
输出:</strong>5<strong>
 | 
						||
解释:</strong>0!, 1!, 2!, 3!, 和 4! 均符合 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> </p>
 | 
						||
 | 
						||
<p><strong>提示:</strong></p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li><code>0 <= k <= 10<sup>9</sup></code></li>
 | 
						||
</ul>
 |