P18945 [GeeksforGeeks] Smallest factorial number5929
普及
题目描述

Given a number n. The task is to find the smallest number whose factorial contains at least n trailing zeroes.
Example 1:
Input:
n = 1
Output: 5
Explanation : 5! = 120 which has at
least 1 trailing 0.
Example 2:
Input:
n = 6
Output: 25
Explanation : 25! has at least
6 trailing 0.
User Task:
Complete the function findNum() which takes an integer N as input parameters, and returns the answer.
Expected Time Complexity: O(log_{2} N * log_{5} N).
Expected Auxiliary Space: O(1).
Constraints:
1 <= n <= 10^{4}

输入格式

见题面

输出格式

见题面

样例输入
n = 1
样例输出
5