P19043 [GeeksforGeeks] N trailing zeroes in factorials5345
普及
题目描述

Given an integer n, find the number of positive integers whose factorial ends with n zeros.

Example 1:
Input:
N = 1
Output: 5
Explanation:
5! = 120, 6! = 720, 7! = 5040,
8! = 40320 and 9! = 362880.

Example 2:
Input:
N = 5
Output: 0
Your Task:
You don't need to read input or print anything. Your task is to complete the function countZeroes() which takes the integer N as input parameters and returns the count of positive numbers whose factorial ends with N zeros.
Expected Time Complexity: O(log(n))
Expected Auxiliary Space: O(1)

Constraints:
1<=N<=1000

输入格式

见题面

输出格式

见题面

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