Problem:


Score : 500 points

Problem Statement

For an integer n not less than 0, let us define f(n) as follows:

f(n) = 1 (if n < 2)

f(n) = n f(n-2) (if n \geq 2)

Given is an integer N. Find the number of trailing zeros in the decimal notation of f(N).

Constraints

0 \leq N \leq 10^{18}

Input

Input is given from Standard Input in the following format:

N

Output

Print the number of trailing zeros in the decimal notation of f(N).

Sample Input 1

12

Sample Output 1

1

f(12) = 12 × 10 × 8 × 6 × 4 × 2 = 46080, which has one trailing zero.

Sample Input 2

5

Sample Output 2

0

f(5) = 5 × 3 × 1 = 15, which has no trailing zeros.

Sample Input 3

1000000000000000000

Sample Output 3

124999999999999995



Sample input:
12


Sample output:
1

Submission status: Wrong Answer

Solution code:
from sys import stdin


def fetch_one_line():
    return stdin.readline().rstrip()


def fetch_int_input():
    return [int(s) for s in fetch_one_line().split()]


def fetch_inputs(times):
    return [fetch_one_line() for _ in range(times)]


def fetch_int_inputs(times):
    return [[int(s) for s in fetch_one_line()] for _ in range(times)]

num = int(fetch_one_line())
sum_answer = 0
waru = 5
while True:
    answer = int(num / waru)
    sum_answer += answer
    waru *= 5
    if answer == 0:
        break
# hoge
print(int(sum_answer / 2))

Submission status: Wrong Answer

Solution code:
N = int(input())

five = 5
ten = 10
cnt5 = 0
cnt10 = 0

if N % 2 == 1:
    while True:
        cnt10 += (N // 2) // ten
        ten *= 10
        if ten > N:
            break
    ans = cnt10
else:
    while True:
        cnt5 += (N // 2) // five
        five *= 5
        if five > N:
            break
    ans = cnt5
print(int(ans))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=5
cnt=0
while a<N:
    cnt+=(N//a)//2
    a*=5
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())

arr_5 = [2*5**(i+1) for i in range(26)]

def answer(N):
    ans = 0
    if N % 2 != 0:
        print(ans)
    else:
        for a in arr_5:
            ans += int(N/a)

        print(int(ans))

answer(N)

Submission status: Wrong Answer

Solution code:
# import numpy as np
import sys
input = sys.stdin.readline

N = int(input())

if N == 0:
    print(1)
    sys.exit()
elif N == 1:
    print(0)
    sys.exit()
elif N % 2 == 1:
    print(0)
    sys.exit()

M = N-N%10

res = 0

while M != 0:
    res += 1
    M -= 10

print(res)

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())

print(N//10)

Submission status: Wrong Answer

Solution code:
import numpy as np
num = int(input())
if num == 0 or num % 2 == 1:
    print(0)
    exit()

n = int(np.log10(num))
b = num // 10 ** n
a =  n * b
if b >= 5:
    a += 1
for i in range(int(n - 2), 1, -1):
    a += i * 10
print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())
result = 0
def keisan(N):
    if N % 10 != 0:
        N = N - N % 10
    result = (N % 50)//10
    if N % 50 != 0:
        result = (N % 50) // 10
        N = N - N % 50
    for j in range(N, 2, -50):
        result += 4
        for i in range(1, len(str(N)) + 1):
            if j % 5 ** i == 0:
                result += 1
    return result

if N == 1:
    print(1)
else:
    if N % 2 == 0:
        print(keisan(N))
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N % 2 == 0:
    for i in range(1, 10000):
        if (N < 5 ** i):
            max5 = i + 1
            break
    for i in range(1, 10000):
        if (N < 2 ** i):
            max2 = i + 1
            break
    ans5 = 0
    for num5 in range(1, max5+1):
        ans5 = ans5 + int(N / (5 ** num5) / 2)
    ans2 = 0
    for num2 in range(1, max2+1):
        ans2 = ans2 + int(N / (2 ** num2))
    print(min(ans2, ans5))
else:
    print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N%2 ==1:
    print(0)
else:
    half = N//2
    sumone=0
    p=1
    while 5**p <half:
        sumone += half//(5**p)
        p+=1
    
    print(sumone)

Submission status: Wrong Answer

Solution code:

N = int(input())
ans=0
p=5
#c2 = 0
c5 = 0
if (N % 2==0):
    N=N/2
    while(N>=p):

        c5 = c5 + N//p
        p=p*5
        ans=c5


print(int(ans))

Submission status: Wrong Answer

Solution code:
n = int(input())
counter = 0
import sys
if n % 2 == 1:
  print(0)
  sys.exit()
else:
  for i in range(1, 19):
    counter += n // (10**i)
print(counter)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
p = 10
su = 0
while p < n:
   su += math.floor(n/p)
   p*=5
print(su)

Submission status: Wrong Answer

Solution code:
def a(x):
  y=1
  if x==1:
    y=1
  else:
    y=a(x-1)*10+2
  return y


n=int(input())
c=0
if n%2==0:
  l=len(str(n))-1

  for i in range(l,0,-1):
    z=(n-n%10**l)/10**i
    c=c+a(i)*z
    if z==5:
      c+=1
    n=n-z*10**i
    print(c)
print(int(c))

Submission status: Wrong Answer

Solution code:
import sys

def main():
    N = int(input())
    sum = 0

    while True:
        if(N%10==0):
            sum+=1
        
        if(N<=2):
            break

        N-=2

    print(sum)

main()

Submission status: Wrong Answer

Solution code:
num = int(input())
divider = 10
count = 0
while(num/divider>=1):
    count += int(num/divider)
    divider = divider * 5
print(int(count))

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
if N % 2 != 0:
    print(0)
elif N < 10:
    print(0)
else:
    li = [1]
    count2 = 1
    for i in range(2, 19):
        count2 *= 10
        count2 += 1
        li.append(count2)
    #print(li)
    strN = str(N)
    restrN = list(reversed(strN))
    #print(restrN)
    for i in range(1, len(restrN)):
        count += int(int(restrN[i]) * li[i-1])
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
answer = 0
number = 5
if N % 2 != 0:
    print(0)
else:
    while number < N:
        answer += N // number // 2 
        number *= 5

print(answer)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = ''

if n % 2 != 0:
    print(0)
else:
    a = n // 10
    for i in range(len(str(a))):
        l += '1'
    print(l)

Submission status: Wrong Answer

Solution code:
n = int(input())
sub = 0
if n % 2 == 1:
    print(0)
else:
    while n >= 10:
        n //= 10
        sub+= n
        if n >= 5:
            if int(str(n)[0]) < 5:
                sub+=(len(str(n))-1)
            else:
                sub+=len(str(n))
        #print("tamesi",sub)
    print(sub)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = 0
p = 0
q = 1
if N % 2 == 1:
  print(0)
else:
  for i in range(18):
    if N >= 10**(i+1):
      p = i+1
  while q <= p:
      a += N//(10**q)
      q += 1
  print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())

#まともにやったら再帰エラーで死ぬ
def factorial(n):
    if (n < 2):
        return 1
    else:
        return n * factorial(n - 2)

if (N == 0):
    print(1)
elif (N % 2 == 0):
    num = int(N / 2)

    #１０で何回わりきれるか

    #5の倍数の数
    fiveFactor = 5
    counter = 0
    while (num >= fiveFactor):
        counter += int(num / fiveFactor)
        fiveFactor *= 5

    print(counter)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**9)
N = int(input())
ans = 0
j = 0
tmp = 10
a = 0
while tmp <= N:
    tmp *= 5
    j += 1
j -= 1
tmp //= 5
b = 0
while j >= 0:
    b = N//tmp
#    ans +=  b
#    a += 5*b
    for i in range(j+1):
        ans += b * 5**i
    N -= b*tmp
    tmp //= 5
    j -= 1
#    print("N:{},ans:{},a:{},b:{},tmp:{},j:{}".format(N,ans,a,b,tmp,j))
print(int(ans))

Submission status: Wrong Answer

Solution code:
import numpy as np
n=int(input())
z=0
j=1
if n%2==0:
	while n//(10**j)>=1:
		z+=(n//(10**j))*j
		# if j!=1:
		# 	z-=(n//(10**j))
		j+=1
else:
	z=0
print(z)

Submission status: Wrong Answer

Solution code:
n=int(input())

if n%2==1:
    print(0)
    exit()


cntTen=0
temp=1
while 5**temp <= n:
    cntTen+=n//(5**temp)
    temp+=1
"""
cntFive=0
temp=1
while 5*10**temp <= n:
    cntFive+=n//(5*10**temp )
    temp+=1
"""

print((int(cntTen//2))-2)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**9)
N = int(input())
ans = 0
j = 0
tmp = 10
a = 0
while tmp <= N:
    tmp *= 5
    j += 1
j -= 1
tmp //= 5
b = 0
while j >= 0:
    b = N//tmp
#    ans +=  b
#    a += 5*b
    for i in range(j+1):
        ans += b * 5**i
    N -= b*tmp
    tmp //= 5
    j -= 1
    print("N:{},ans:{},a:{},b:{},tmp:{},j:{}".format(N,ans,a,b,tmp,j))
print(int(ans))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())

a1  = N // 10
a2  = N // 100
a3  = N // 1000
a4  = N // 10000
a5  = N // 100000
a6  = N // 1000000
a7  = N // 10000000
a8  = N // 100000000
a9  = N // 1000000000
a10 = N // 10000000000
a11 = N // 100000000000
a12 = N // 1000000000000
a13 = N // 10000000000000
a14 = N // 100000000000000
a15 = N // 1000000000000000
a16 = N // 10000000000000000
a17 = N // 100000000000000000
a18 = N // 1000000000000000000
a19 = N // 10000000000000000000

b1  = (N // 50) - a2
b2  = (N // 250  ) - a3
b3  = (N // 1250 ) - a4
b4  = (N // (5**4)*10 ) - a5
b5  = math.ceil(N // (5**5)*10 ) - a6
b6  = math.ceil(N // (5**6)*10 ) - a7
b7  = math.ceil(N // (5**7)*10 ) - a8
b8  = math.ceil(N // (5**8)*10 ) - a9
b9  = math.ceil(N // (5**9)*10 ) - a10
b10 = math.ceil(N // (5**10)*10 ) - a11
b11 = math.ceil(N // (5**11)*10 ) - a12
b12 = math.ceil(N // (5**12)*10 ) - a13
b13 = math.ceil(N // (5**13)*10 ) - a14
b14 = math.ceil(N // (5**14)*10 ) - a15
b15 = math.ceil(N // (5**15)*10 ) - a16
b16 = math.ceil(N // (5**16)*10) - a17
b17 = math.ceil(N // (5**17)*10 ) - a18
b18 = math.ceil(N // (5**18)*10 ) - a19

ans = a1*1 + a2*1+ a3*1+ a4*1 + a5*1+ a6*1+ a7*1+ a8*1+ a9*1+ a10*1+ a11*1+ a12*1+ a13*1+ a14*1+ a15*1+ a16*1+ a17*1+ a18*1+ a19*1
ans = ans + b1*1 + b2*1+ b3*1+ b4*1 + b5*1+ b6*1+ b7*1+ b8*1+ b9*1+ b10*1+ b11*1+ b12*1+ b13*1+ b14*1+ b15*1+ b16*1+ b17*1+ b18*1

#124999999999999995
#111111111111111111
# 12888888888888884
#1000000000000000000

if N % 2 == 1:
  print(0)
else:
  print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())

if n%2==1:
    print(0)
    exit()


cntTen=0
temp=1
while 5**temp <= n:
    cntTen+=n//(5**temp)
    temp+=1

print((int(cntTen//2)))

Submission status: Wrong Answer

Solution code:
N = int(input())
if N % 2 != 0:
    print('0')
else:
    print(N // 10)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
for i in [5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625, 48828125, 244140625, 1220703125, 6103515625, 30517578125, 152587890625, 762939453125, 3814697265625, 19073486328125, 95367431640625, 476837158203125, 2384185791015625, 11920928955078125, 59604644775390625, 298023223876953125, 1490116119384765625]:
  ans+=n//i
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
if (N < 10) or (N % 2 != 0):
    print(0)

def calc(N):
    S = str(N)
    cnt = 0
    for x in S:
        if(x == "0"):
            cnt +=1
    return cnt
#print(N % 10)
number = 0
plus = 10
while N >= 10:
    if(N / 10 >= 10):
        number += plus
        plus *= 10
    N = N / 10
#print(N)
print(number+int(N))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = 0

def solve(x):
    temp = '9'
    ans = x
    x -= 1
    while x > 0:
        ans += x * int(temp)
        x -= 1
        temp += '9'

    return ans

# while n / 10 > 0:
#     n // 10

# print(solve(5))

n = n // 10
cnt = 1

while n > 0:
    t = n % 10
    a += t * solve(cnt)
    cnt += 1
    n = n // 10

print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())


print(N // 10)

Submission status: Wrong Answer

Solution code:
N = input()
if int(N) % 2 == 1:
    print(0)
    exit()

L = len(N)
dp = [[[0] * (L + 1) for _ in range(2)] for _ in range(L + 1)]
dp[0][0][0] = 1

for i in range(L):
    D = int(N[i])
    for j in range(2):
        for k in range(L):
            max_d = 9 if j else D
            for d in range(max_d + 1):
                # if i == 0:
                #     if d != 0:
                #         dp[i + 1][j | (d < D)][0] += dp[i][j][k]
                # else:
                #     if d == 0:
                #         dp[i + 1][j | (d < D)][k + 1] += dp[i][j][k]
                #     else:
                #         dp[i + 1][j | (d < D)][0] += dp[i][j][k]
                if d == 0:
                    dp[i + 1][j | (d < D)][k + 1] += dp[i][j][k]
                else:
                    dp[i + 1][j | (d < D)][0] += dp[i][j][k]

ans = 0
for k in range(1, L + 1):
    ans += k * (dp[L][1][k])
print(ans)

Submission status: Wrong Answer

Solution code:

N = int(input())
ans=0
p=5
#c2 = 0
c5 = 0
if (N % 2==0):
    while(N>=p):

        c5 = c5 + N//p
        p=p*5
        ans=c5


print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
if N < 2:
  Ans = 1
else:
  n = N % 2
  AB = [N]
  if n == 0:
    ni = N //2 -1
  else:
    ni = N //2
  for i in range(ni):
    ab = AB[-1] - 2
    AB.append(ab)
  Ans = np.prod(AB)
Ans = str(Ans)
Ans = list(reversed(Ans))
ans = []
for i in range(len(Ans)):
  if Ans[i] == '0':
    ans.append(i)
  else:
    break
print(len(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())

def s_n(i):
    s=i*(i+1)/2
    return(s)

if n<=6:
    print(0)
else:
    if n%2==0:
        print(int(s_n(n//10)))
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N = int(input())

if N % 2 != 0:
    print(0)
else:
    def get_zero_num(n):
    #         n == 10 ** N only
        zero_num = 0
        for i in range(len(str(n)) - 1):
            zero_num = zero_num * 10 + 1
        return zero_num
    
    zero_num = 0
    str_N = str(N)
    for i in range(len(str_N)):
        zero_num += int(str_N[i]) * get_zero_num(int(str_N[i]) * (10 **(len(str_N) - (i + 1))))
    print(zero_num)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())

a1  = N // 10
a2  = N // 100
a3  = N // 1000
a4  = N // 10000
a5  = N // 100000
a6  = N // 1000000
a7  = N // 10000000
a8  = N // 100000000
a9  = N // 1000000000
a10 = N // 10000000000
a11 = N // 100000000000
a12 = N // 1000000000000
a13 = N // 10000000000000
a14 = N // 100000000000000
a15 = N // 1000000000000000
a16 = N // 10000000000000000
a17 = N // 100000000000000000
a18 = N // 1000000000000000000
a19 = N // 10000000000000000000

b1  = (N // 50) - a2
b2  = (N // 250  ) - a3
b3  = (N // 1250 ) - a4
b4  = (N // (5**4)*10 ) - a5
b5  = math.ceil(N // (5**5)*10 ) - a6
b6  = math.ceil(N // (5**6)*10 ) - a7
b7  = math.ceil(N // (5**7)*10 ) - a8
b8  = math.ceil(N // (5**8)*10 ) - a9
b9  = math.ceil(N // 5000000000 ) - a10
b10 = math.ceil(N // 50000000000 ) - a11
b11 = math.ceil(N // 500000000000 ) - a12
b12 = math.ceil(N // 5000000000000 ) - a13
b13 = math.ceil(N // 50000000000000 ) - a14
b14 = math.ceil(N // 500000000000000 ) - a15
b15 = math.ceil(N // 5000000000000000 ) - a16
b16 = math.ceil(N // 50000000000000000) - a17
b17 = math.ceil(N // 500000000000000000 ) - a18
b18 = math.ceil(N // 5000000000000000000 ) - a19

ans = a1*1 + a2*1+ a3*1+ a4*1 + a5*1+ a6*1+ a7*1+ a8*1+ a9*1+ a10*1+ a11*1+ a12*1+ a13*1+ a14*1+ a15*1+ a16*1+ a17*1+ a18*1+ a19*1
ans = ans + b1*1 + b2*1+ b3*1+ b4*1 + b5*1+ b6*1+ b7*1+ b8*1+ b9*1+ b10*1+ b11*1+ b12*1+ b13*1+ b14*1+ b15*1+ b16*1+ b17*1+ b18*1

#124999999999999995
#111111111111111111
# 12888888888888884
#1000000000000000000

if N % 2 == 1:
  print(0)
else:
  print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N%2==1:
    print(0)
else:
    A = N//10
    B = A//5
    print(A+B)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
ans = 0
if(n%2 != 1):
  for i in range(1,30):
    tmp = n/2
    for _ in range(i):
      tmp = tmp / 5
    ans = ans + math.floor(tmp)
print(ans)

Submission status: Wrong Answer

Solution code:

from sys import stdin

n = int(stdin.readline().rstrip())

if (n % 2 == 1):
 print (0)
else:
 print(n // 10)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = ''

if n % 2 != 0:
    print(0)
else:
    a = n // 10
    for i in range(a):
        l += '1'
    print(l)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N%2 == 0:
    print(N)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())

if (N % 2 == 1):
    print(0)
    exit()

print(N*25//200)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 10
ans = 0
while n > i:
    ans += n // i
    i *= 5
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

print(int((n - n%10) / 10))

Submission status: Wrong Answer

Solution code:
N = int(input())
if N % 2 == 0:
    for i in range(1, 10000):
        if (N < 5 ** i):
            max5 = i + 1
    for i in range(1, 10000):
        if (N < 2 ** i):
            max2 = i + 1
    ans5 = 0
    for num5 in range(1, max5):
        ans5 = ans5 + int(N / (5 ** num5) / 2)
    ans2 = 0
    for num2 in range(1, max2):
        ans2 = ans2 + int(N / (2 ** num2) / 2)
    print(min(ans2, ans5))
else:
    print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())
tens = 0
ans = 0
warimono = 5

if N % 2 == 1:
    print(0)
else:
    tens = int(N / 10)
    ans = tens
    
    while tens > 0:
        tens = int(tens/warimono)
        ans += tens

    print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())

nlist = []
while True:
    if N >= 2:
        nlist.append(N)
        N = N - 2
    else:
        nlist.append(1)
        break
nlist = np.array(nlist)
print(nlist)
prodN = np.prod(nlist)

number = list(str(prodN))

counter = 0
for i in reversed(number):
    if i == '0':
        counter += 1
    else:
        break

print(counter)

Submission status: Wrong Answer

Solution code:
n=int(input())

def f(n):
    ans=1
    while n>0:
        ans*=n
        n-=2
    return ans

def g(x):
    i=1
    cnt=0
    while i<=20:
        if x%10==0:
            cnt+=1
            x=x/10
            i+=1
        else:
            exit()
        print(cnt)

if n<=9:
    print(0)
else:
  g(f(n))

Submission status: Wrong Answer

Solution code:
#!python3

def f1(x, y):
    i = 0
    while True:
        z = 0
        x, z = divmod(x, y)
        if z:
            break
        i += 1
    return i

def resolve():
    N = int(input())

    if N < 2 or (N % 2) == 1:
        print(0)
        return


    n = N // 10
    a = 50
    while a < N:
        n += N // a
        a *= 5

    print(n)

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
n=int(input())
if n%2==1:
    print(0)
else:
    num=len(str(n))*10
    n=int(n/2)

    ans=0
    for i in range(num):
        ans+=n//(5**(i+1))
    print(int(ans))

Submission status: Wrong Answer

Solution code:
N=int(input())
c=N%10
if c%2==1:
  print("0")
else:
  i=1
  b=0
  while i<=100:
    b+=int(N/(2*(5**i)))
    i+=1
  else:
    print(b)

Submission status: Wrong Answer

Solution code:
def f(n):
	if(n%2==0):
		return int(n/10)
	else:
		return 0
a=int(input())
if (a<=10**18 and a>=0):
  print(f(a))

Submission status: Wrong Answer

Solution code:
num = int(input())
count = 0
divider = 10
while int(num/divider) > 0:
  count += int(num/divider)
  divider *= 5

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = 0
p = 0
if N % 2 == 1:
  print(0)
else:
  while N >= 1:
    a += N//10
    N = N/10
  print(int(a))

Submission status: Wrong Answer

Solution code:
def findTrailingZeros(n): 
    count = 0
    i=10
    while (n/i>=1): 
        count += int(n/i)
        i *= 5
    return int(count)

Submission status: Wrong Answer

Solution code:
import sys

import numpy as np

N = int(input())

if N % 2 != 0:
    print(0)
    sys.exit()

N = N // 10 * 10

ans = 0
for i in range(1, 19):
    if N < 10**i:
        break
    ans += N // 10**i

ans += N // 50
ans -= N // 200

print('ans', ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
cnt=5
if n%2==0:
    while True:
        tmp=n//cnt
        if tmp==0:
            break
        else:
            ans+=tmp
            cnt=cnt*5
print(ans//2-n//(1000000000000000000//2))

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
N=int(input())
a=5
cnt=0
while a<=N:
    cnt+=Decimal(N//a//2)
    a=Decimal(a*5)
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())

arr_5 = [2*5**(i+1) for i in range(24)]

ans = 0
for a in arr_5:
    if N % a == 0:
        ans += int(N/a)

print(int(ans))

Submission status: Wrong Answer

Solution code:
def primeFactorization(n):
    num = n
    tmp = 3
    result = []
    
    if num == 0:
        return []
    
    while num % 2 == 0:
        result.append(2)
        num //= 2
    
    while tmp * tmp <= num:
        while num % tmp == 0:
            result.append(tmp)
            num //= tmp
        tmp += 2
    
    if tmp != 1 and num != 1:
        result.append(num)
    
    return result

n = int(input())

if n % 2 == 0:
    result = n // 10
    num = n//10
    while 5 <= num / 5:
        num //= 5
        result += num
    if 5 < num:
        result += 1
    print(result)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
import math

def count(L):
  K=0
  for l in range(L):
    K+=10**(L-l-1)
  return K
      
N=int(input())

if N%2==1:
  print(0)
else:
  R = 0
  while True:
    if N<10:
      break
    L=int(math.log10(N))
    M=int(N/10**L)
    R+=M*count(L)
    N = N-M*10**L
  print(R)

Submission status: Wrong Answer

Solution code:
    
def even(n):
    count = 0
    i = 10
    while(n/i>=1):
        count += int(n/i)
        i *= 10
    return int(count)

def main():
    N = int(input())

    if N < 2:
        print(0)

    # even
    elif N % 2 == 0:
        print(even(N))
    # odd
    elif N % 2 == 1:
        print(0)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())

f = 1

if N >= 2:
  while N > 0:
    f = f * N
    N = N - 2

count5 = 0
count2 = 0

while (f % 5 == 0 and f % 2 == 0):
  if f % 5 == 0:
    count5 = count5 + 1
    f = f / 5
  if f % 2 == 0:
    count2 = count2 + 1
    f = f / 2

if count2 > count5:
  print(count5)
if count2 < count5:
  print(count2)
if count2 == count5:
  print(count2)

#print('N = ', N)
#print('f = ', f)

Submission status: Wrong Answer

Solution code:
N=int(input())
c=N%10
if c%2==1:
  print("0")
else:
  i=1
  b=0
  while i<=27:
    b+=int(N/(2*(5**i)))
    i+=1
  else:
    print(b)

Submission status: Wrong Answer

Solution code:
n = int(input())

dp = 0
ans = 0
for i in reversed(range(1,30)):
    ans += n // 5**i //2

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math
n = int(sys.stdin.readline())

def calc(num):
    cnt=0
    while True:
        if num %10==0:
            cnt+=1
            num = num//10
        else:
            break
    return cnt


if n%2==1:
    print(0)
else:
    c10=0
    while True:
        b = calc(n)
        c10+=b
        n-=10
        if n<10:
            break
    print(c10)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
if N % 2 == 1:
  print(0)
else:
  for i in range (1,30):
    if N >= 5 ** i:
      ans = ans + int(int(N / (5 ** i)) / 2)
  print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n%2==1:
    print(0)
else:
    if n==0:print(1)
    else:
        num=len(str(n))*2
        n=int(n/2)

        ans=0
        for i in range(num):
            ans+=n//(5**(i+1))
        print(int(ans))

Submission status: Wrong Answer

Solution code:
def findTrailingZeros(n): 
    count = 0
    i=10
    while (n/i>=1): 
        count += int(n/i)
        i *= 5
        n = n - 2
    return int(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0

if n % 2 == 1:
    print(0)
elif n % 2 == 0:
    for i in range(1, 27):
        ans += int((n / 2) / (5 ** i))
    print(ans)

Submission status: Wrong Answer

Solution code:
i = int(input())
now = 0

for j in range(1000):
    now += i // (10 * (5 ** j))
print(now)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N%2:
  print("0")
else:
  ans = N // 10
  i = 10
  while True:
    subans = N // (5*i)
    ans += subans
    i *= 10
    if i > N:break
  print(ans)

Submission status: Wrong Answer

Solution code:
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

N=one_int()

if N%2==0:
    sums =0
    for i in range(1,26):
        sums += (N/2)//(5**i)
    print(int(sums) - N//170000000000000000)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**9)
N = int(input())
ans = 0
j = 0
tmp = 10
a = 0
while tmp <= N:
    tmp *= 5
    j += 1
j -= 1
tmp /= 5
b = 0
while j >= 0:
    b = N//tmp
#    ans +=  b
#    a += 5*b
    for i in range(j+1):
        ans += b * 5**i
    N -= b*tmp
    tmp /= 5
    j -= 1
#    print("N:{},ans:{},a:{},b:{},tmp:{},j:{}".format(N,ans,a,b,tmp,j))
print(int(ans))

Submission status: Wrong Answer

Solution code:
def a(x):
  y=1
  if x==1:
    y=1
  else:
    y=a(x-1)*10+2
  print("def",y)
  return y


n=int(input())
c=0
if n%2==0:
  l=len(str(n))-1

  for i in range(l,0,-1):
    print(i)
    z=(n-n%10**l)/10**i
    c=c+a(i)*z
    if z==5:
      c+=1
    n=n-z*10**i
    print(c)
print(int(c))

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0

if n%2 == 1:
    print("0")
else:
    for i in range(len(str(n))-1):
        ans += int(n/(10**(i+1)))


    for j in range(1,30):
        five = (5 ** j) * 10
        for i in range(20):
            ans += int(n/(2*five**(i+1)))
    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
c = 0

if n % 2 == 1:
  c = 0
else:
  a = len(str(n))
  for i in range(a,0,-1):
    c+= i*(n // (10 ** i))
print(c)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

c2 = 0
c5 = 0

if N % 2 == 1:
  print(0)
else:
  N = int(N/2)
  c2 += int(N/2)
#  for i in range(1, int(math.sqrt(N)) + 1):
#    c2 += int(N / (2**i))
  for i in range(1, int(N**(1/5)) + 1):
    c5 += int(N / (5**i))
#  print(c2)
  print(c5)
#  print(min(c2,c5))

Submission status: Wrong Answer

Solution code:
def f(n):
	if(n%2==0):
		return int(n/10)
	else:
		return 0
print(f(int(input())))

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
for i in range(18):
  ans+=n//(10**(i+1))
print(ans)

Submission status: Wrong Answer

Solution code:
import collections

# 素因数分解
def prime_factorize(n):
    a =[]

    while n % 2 == 0:
        a.append(2)
        n //= 2
    
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    
    if n != 1:
        a.append(n)
    
    return a

n = int(input())
result = collections.Counter(prime_factorize(n))
print(min(result[2],result[5]))

Submission status: Wrong Answer

Solution code:
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

N=one_int()

if N%2==0:
    sums =0
    for i in range(1,26):
        sums += (N/2)//(5**i)
    print(int(sums) - N//170000000000000000)
else:
    print(0)

sums =0
for i in range(1,26):
    sums += (N/2)//(5**i)
print(int(sums) - N//170000000000000000)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N % 2 == 0:
    num_list5 = []
    for i in range(1, 10000):
        num_list5.append(i)
        if (N < 5 ** i):
            break
    num_list2 = []
    for i in range(1, 10000):
        num_list2.append(i)
        if (N < 2 ** i):
            break
    ans_list5 = []
    for num5 in num_list5:
        ans_list5.append(int(N / (5 ** num5) / 2))
    ans_list2 = []
    for num2 in num_list2:
        ans_list2.append(int(N / (2 ** num2) / 2))
    ans5 = 0
    for i in range(len(ans_list5)):
        ans5 = ans5 + ans_list5[i]
    ans2 = 0
    for i in range(len(ans_list2)):
        ans2 = ans2 + ans_list2[i]
    print(min(ans2, ans5))
else:
    print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())

chk = False
chk1 = True
bis = 5
ans = 0
if (n % 2 ==1) or (n<10):
    print(0)

else:
    #while chk == False:
    #    if list(str(n))[-1] == "0":
    #        chk = True
    #    else:
    #        n -=2
            
    while n > bis:
        
        ans += n // bis
        bis = bis *5

        
        
    print(ans//2)

Submission status: Wrong Answer

Solution code:
N = int(input())

cnt = 0


def f(n):
    if n < 2:
        return 1
    else:
        s = n
        while n >= 3:
            s *= n - 2
            s %= 10 ** 19 + 9
            n = n - 2
        return s % (10 ** 19 + 9)


for i in reversed(str(f(N))):
    if i == "0":
        cnt += 1
    else:
        break

print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
bbn=1000000007
	
#+++++

def ai(n, c):
	if n <= 1:
		return c
	else:
		p=0
		b=n
		while b % 10 == 0:
			p+=1
			b=b//10
		return ai(n-2, c+p)
		
def main():
	n = int(input())
	if n%2==1:
		return 0
	bb=1	
	ret=0
	while n >= 10**bb:
		ret += n // 10**bb
		bb+=1
	#pa(ai(n,0))
	print(ret)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())

if N % 2 == 1:
    print(0)
    sys.exit()
count = 0
start = 10
start_lis = []
while start < N:
    start_lis.append(start)
    start = start // 2
    if int(str(start)[-1]) == 5:
        start *= 10
        
tmp10 = 10
while True:
    count += N // tmp10
    tmp10 *= 10
    if tmp10 > N:
        break

for i in range(1, len(start_lis)):
    tmp = start_lis[i]
    while True:
        count += (N + tmp) // (tmp * 2)
        tmp *= 10
        if tmp > N:
            break
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
count = 0
for i in range(35):
    a = 5 ** i * 10
    b = n // a
    count += b


print(count)

Submission status: Wrong Answer

Solution code:
i = int(input())
now = 0
now += i // 10
now += i // 50
for j in range(10000):
    now += i // (250 * (5 ** j))
print(now)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n%2==1:
    print(0)
else:
    num=len(str(n))*2
    n=int(n/2)

    ans=0
    for i in range(num):
        ans+=n//(5**(i+1))
        # ans+=n//(10**(i+1))
        # s=int(n/2)
        # ans+=(s//(10*(5**(i+1))))
    print(int(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())

arr_5 = [2*5**(i+1) for i in range(24)]

ans = 0
for a in arr_5:
    ans += int(N/a)

print(int(ans))

Submission status: Wrong Answer

Solution code:
def f(n):
	if(n%2==0):
		return int(n/10)
	else:
		return int(n/5)
print(f(int(input())))

Submission status: Wrong Answer

Solution code:
n=int(input())

if n//2==n/2:
    a=1
    while not n<5**a:
        a=a+1

    m=0
    for i in range(1,a):
        m=m+n//(2*(5**i))
    print(m-1)


else:
    print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())
count = 0
for i in range(30):
    a = 5 ** i * 10
    b = n // a
    count += b


print(count)

Submission status: Wrong Answer

Solution code:
i = int(input())
now = 0
now += i // 10
now += i // 50
for j in range(100):
    now += i // (250 * (5 ** j))
print(now)