💡문제접근
N!의 값을 10으로 나눠주는 과정을 반복하면 간단하게 해결할 수 있을 것이라고 생각했다.
💡코드(메모리 : 32540KB, 시간 : 36ms)
import math
N = int(input())
N_factorial = math.factorial(N)
cnt = 0
while True:
if N_factorial % 10 == 0:
N_factorial //= 10
cnt += 1
else:
break
print(cnt)
💡소요시간 : 1m