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:
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from math import factorial, sqrt, ceil, gcd
from functools import lru_cache, reduce
from decimal import Decimal
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)

# UnionFind
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# ダイクストラ
def dijkstra_heap(s, edge, n):
    #始点sから各頂点への最短距離
    d = [10**20] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d

# 素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# 2数の最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

# リストの要素の最小公倍数
def lcm_list(numbers):
    return reduce(lcm, numbers, 1)

# リストの要素の最大公約数
def gcd_list(numbers):
    return reduce(gcd, numbers)

# 素数判定
def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True


# limit以下の素数を列挙
def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P

# 同じものを含む順列
def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        # set（集合）型で重複を削除、ソート
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret


# ここから書き始める
n = int(input())
ans1 = 0
ans2 = 0
d1 = 1
d2 = 1
while 2 ** d1 * 2 <= n:
    ans1 += n // 2 ** d1
    d1 += 1
while 5 ** d2 * 2 <= n:
    ans2 += n // (5 ** d2 * 2)
    d2 += 1
ans = min(ans1, ans2)
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from math import factorial, sqrt, ceil, gcd
from functools import lru_cache, reduce
from decimal import Decimal
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)

# UnionFind
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# ダイクストラ
def dijkstra_heap(s, edge, n):
    #始点sから各頂点への最短距離
    d = [10**20] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d

# 素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# 2数の最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

# リストの要素の最小公倍数
def lcm_list(numbers):
    return reduce(lcm, numbers, 1)

# リストの要素の最大公約数
def gcd_list(numbers):
    return reduce(gcd, numbers)

# 素数判定
def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True


# limit以下の素数を列挙
def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P

# 同じものを含む順列
def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        # set（集合）型で重複を削除、ソート
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret


# ここから書き始める
n = int(input())
ans1 = 0
ans2 = 0
d1 = 1
d2 = 1
while 2 ** d1 * 2 <= n:
    ans1 += n // (2 ** d1 * 2)
    d1 += 1
while 5 ** d2 * 2 <= n:
    ans2 += n // (5 ** d2 * 2)
    d2 += 1
ans = min(ans1, ans2)
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from math import factorial, sqrt, ceil, gcd
from functools import lru_cache, reduce
from decimal import Decimal
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)

# UnionFind
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# ダイクストラ
def dijkstra_heap(s, edge, n):
    #始点sから各頂点への最短距離
    d = [10**20] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d

# 素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# 2数の最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

# リストの要素の最小公倍数
def lcm_list(numbers):
    return reduce(lcm, numbers, 1)

# リストの要素の最大公約数
def gcd_list(numbers):
    return reduce(gcd, numbers)

# 素数判定
def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True


# limit以下の素数を列挙
def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P

# 同じものを含む順列
def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        # set（集合）型で重複を削除、ソート
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret


# ここから書き始める
n = int(input())
ans1 = 0
ans2 = 0
d1 = 1
d2 = 1
while 2 ** d1 * 2 <= n:
    ans1 += n // (2 ** d1 * 2)
    d1 += 1
while 5 ** d2 <= n:
    ans2 += n // (5 ** d2 * 2)
    d2 += 1
ans = min(ans1, ans2)
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(input())

def f(n):
    if n < 2:
        return 1
    else:
        return n * f(n - 2)

if N % 2 == 1:
    print(0)
else:
    ans = 0
    x = 5
    while x * 2 <= N:
        ans += N // x
        x *= 5
    print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(input())

def f(n):
    if n < 2:
        return 1
    else:
        return n * f(n - 2)

if N % 2 == 1:
    print(0)
else:
    ans = 0
    ex = 0
    for i in range(18, 0, -1):
        x = N // (10 ** i) - ex
        ans += x * i 
        ex += x
    print(ans)

Submission status: Wrong Answer

Solution code:
from decimal import getcontext, Decimal
getcontext().prec = 100

N = int(input())
if N % 2 == 1:
	print(0)
else:
	ans = 0
	if N <= 9:
		pass
	else:
		ans += N//10
		N = int(N/10)
		while N >= 5:
			ans += N//5
			N = int(N/5)
	print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N % 2 == 1:
	print(0)
else:
	ans = 0
	if N <= 9:
		pass
	else:
		ans += N//10
		N = int(N/10)
		while N >= 5:
			ans += N//5
			N = int(N/5)
	print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N % 2 == 1:
	print(0)
elif N == 0:
	print(1)
else:
	ans = 0
	if N <= 9:
		pass
	else:
		ans += N//10
		N = int(N/10)
		while N >= 5:
			ans += N//5
			N = int(N/5)
	print(ans)

Submission status: Wrong Answer

Solution code:
# def f(n):
#     if n < 2:
#         return 1
#     else:
#         return n * f(n - 2)

# for i in range(2, 150, 2):
#     print(i, f(i))

N = int(input())

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

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

k = 10
cnt = 0
while k < N:
    cnt += N // k
    k *= 5

print(cnt)

Submission status: Wrong Answer

Solution code:
# def f(n):
#     if n < 2:
#         return 1
#     else:
#         return n * f(n - 2)

# for i in range(2, 150, 2):
#     print(i, f(i))

N = int(input())

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

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

k = 10
cnt = 0
while k <= N:
    cnt += N // k
    k *= 5

print(cnt)

Submission status: Wrong Answer

Solution code:
# def f(n):
#     if n < 2:
#         return 1
#     else:
#         return n * f(n - 2)

# for i in range(2, 150, 2):
#     print(i, f(i))

N = int(input())

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

k = 10
cnt = 0
while k < N:
    cnt += N // k
    k *= 5

print(cnt)

Submission status: Wrong Answer

Solution code:
#E
N=int(input())
ans=0
if N%2==0:
    N=int(N/2)
else:
    N=-1
cnt=1
while cnt<=N:
    cnt*=5
    ans+=N//cnt
print(ans)

Submission status: Wrong Answer

Solution code:
#E
N=int(input())
ans=0
if N%2==0:
    N=int(N/2)
else:
    N=-1
cnt=1
while cnt<=N:
    cnt*=5
    ans+=N//cnt
    print(ans)
print(ans)

Submission status: Wrong Answer

Solution code:
#E
N=int(input())
ans=0
if N%2==0:
    N=N/2
else:
    N=-1
cnt=1
while cnt<=N:
    cnt*=5
    ans+=N//cnt
print(int(ans))

Submission status: Wrong Answer

Solution code:
#E
N=int(input())
ans=0
if N%2==0:
    N/=2
else:
    N=0
while N>=1:
    N-=N%5
    N=int(N/5)
    ans+=N
print(ans)

Submission status: Wrong Answer

Solution code:
def q_e():
    n = int(input())

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

    n5 = n
    c5 = 0
    x = 10
    while n >= x:
        c5 += int(n / x)
        x *= 5

    print(c5)

if __name__ == '__main__':
    q_e()

Submission status: Wrong Answer

Solution code:
def q_e():
    n = int(input())

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

    n5 = n / 2
    c5 = 0
    x = 5
    while n5 >= x:
        b = n5 % x
        a = int((n5 - b) / x)
        c5 += a
        x *= 5

    x = 2
    c2 = 0
    while n >= x:
        b = n % x
        a = int((n - b) / x)
        c2 += a
        x *= 2

    print(min(c5,c2))

if __name__ == '__main__':
    q_e()

Submission status: Wrong Answer

Solution code:
def q_e():
    n = int(input())

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

    cc = 0
    x = 10
    while n >= x:
        b = n % x
        a = int((n - b) / x)
        cc += a
        x *= 5
    print(cc)

if __name__ == '__main__':
    q_e()

Submission status: Wrong Answer

Solution code:
def q_e():
    n = int(input())

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

    n = int(n/2)

    cc = 0
    x = 1
    x *= 5
    while n >= x:
        b = n % x
        a = int((n - b) / x)
        cc += a
        x *= 5
    print(cc)

if __name__ == '__main__':
    q_e()

Submission status: Wrong Answer

Solution code:
def solve(N):
    if N%2==1:
        return 0
    N2=(N-N%10)//10
    count_zero=N2
    x=5
    while N2>x:
        count_zero+=N2//x
        x*=5
    return count_zero
    
        
    

N=int(input())
print(solve(N))

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

if N % 2 == 1:
    print(0)
else:
    i = 10
    ans = 0
    while(True):
        a = math.floor(N / i)
        if a < 1:
            break
        ans += a
        i *= 5
    print(ans)

Submission status: Wrong Answer

Solution code:

N = int(input())

k, l = divmod(N, 2)

if l == 1:
    print(0)
elif N == 0:
    print(1)
else:
    cnt = 0
    while k > 1:
        cnt += k // 5
        k //= 5

    print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())

k = N // 2

if k == 1:
    print(0)
elif N == 0:
    print(1)
else:
    cnt = 0
    while k > 1:
        cnt += k // 5
        k //= 5

    print(cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
if n % 2==0:
    for i in range(1,10000):
        waru = 2*5**i
        if n <= waru:
            break
        else:
            tmp = n//waru
            ans += tmp
print(str(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
if n % 2==0:
    for i in range(1,10000):
        waru = 2*5**i
        if n <= waru:
            break
        else:
            tmp = n/waru
            ans += int(tmp)
print(str(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
if n % 2==0:
    for i in range(1,10000):
        waru = 2*5**i
        if n < waru:
            break
        else:
            tmp = n/waru
            ans += int(tmp)
print(str(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
if n % 2==0:
    for i in range(1,100):
        waru = 2*5**i
        if n < waru:
            break
        else:
            tmp = n/waru
            ans += int(tmp)
print(str(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
if n % 2==0:
    for i in range(1,22):
        waru = 2*5**i
        if n < waru:
            break
        else:
            tmp = n/waru
            ans += int(tmp)
print(str(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
if n % 2==0:
    for i in range(1,19):
        waru = 2*5**i
        if n < waru:
            break
        else:
            tmp = n/waru
            ans += int(tmp)
print(str(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
if n % 2==1:
    for i in range(1,19):
        waru = 2*5**i
        if n < waru:
            break
        else:
            tmp = n/waru
            ans += int(tmp)
print(str(ans))

Submission status: Wrong Answer

Solution code:
n = int(input())

p = 10
a = 0
while p <= n:
    a += n // p
    p *= 5
print(a)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
import math

N = int(input())
# N, K = [int(i) for i in input().split()]
if N == 0:
    print(1)
    sys.exit(0)
if N % 2 == 1:
    print(0)
    sys.exit(0)

count = 0
digit = math.ceil(math.log(N, 5))
for i in range(1, digit+1):
    x = 5 ** i
    count += (N // (x * 2))
print(count)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    if n%2==1:
        print(0)
    else:
        ans = 0
        i = 1
        if n<10:
            print(0)
            return
        while n>=5**i:
            ans += int(n/(5**(i-1)*10))
            i += 1
        print(ans)
        
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())

import sys
if N & 1:
    print(0)
    sys.exit()

ans = 0
N /= 2
while N != 0:
    ans += N // 5
    N /= 5

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
if n%2==1:
  print(ans)
else:
  while n%5==0:
    ans+=n//5
    n=n//5
  print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

res = 0
m = 10
while n // m > 0:
    res += n // m
    m *= 5

print(res)

Submission status: Wrong Answer

Solution code:
n=int(input())
r=0
i=1
while 2*5**i<=n:
	r+=n//(2*5**i)
	i+=1
print(r)

Submission status: Wrong Answer

Solution code:
n = int(input())


if n%2 == 1:
    print(0)
else:
    answer = 0
    count = 1
    n=int(n/2)
    while 5**count <= n:
        answer += n//pow(5,count)
        count+=1
    print(answer)

Submission status: Wrong Answer

Solution code:
n = int(input())


if n%2 == 1:
    print(0)
else:
    answer = 0
    count = 1
    n=int(n/2)
    while 5**count <= n:
        answer += int(pow(n//5,count))
        count+=1
    print(answer)

Submission status: Wrong Answer

Solution code:
n = int(input())


if n == 0:
    print(1)
elif n%2 == 1:
    print(0)
else:
    answer = 0
    count = 1
    n=n/2
    while 5**count <= n:
        answer+=int(n//5**count)
        count+=1
    print(answer)

Submission status: Wrong Answer

Solution code:
n = int(input())


if n < 2:
    print(0)
elif n%2 == 1:
    print(0)
else:
    answer = 0
    count = 1
    n=n/2
    while 5**count <= n:
        answer+=int(n//5**count)
        count+=1
    print(answer)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n%2 == 1:
    print(0)
    
else:
    answer = 0
    count = 1
    n=n/2
    while 5**count <= n:
        answer+=int(n//5**count)
        count+=1
    print(answer)

Submission status: Wrong Answer

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

    i = 10
    x, _ = divmod(n, i)
    while x:
        c += x
        i *= 5
        x, _ = divmod(n, i)

    print(c)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())

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

point = 0
now = 10

while now < n:
    point += n//now
    now *= 5

print(point)

Submission status: Wrong Answer

Solution code:
N=int(input())

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

L=len(str(N))
ans=0
now=5
while N//now>0:
    ans+=((N//now)//2)
    now*=5
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())

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

L=len(str(N))
ans=0
now=5
while N//now>0:
    ans+=((N//now)//2)
    now*=5
print(ans)

Submission status: Wrong Answer

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

    print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
def double_fac(n):
    if n<=2:
        return n
    return n*double_fac(n-2)
tmp=0
if n%2==1:
    ans=0
    print(ans)
else:

    r=1
    ans=0
    k=n
    while 10*r < n:
        ans+=(n//(10*r))
        r*=5
    if n==0:
        ans=1
    print(ans)
#print(double_fac(n))

Submission status: Wrong Answer

Solution code:
n = int(input())
def double_fac(n):
    if n<=2:
        return n
    return n*double_fac(n-2)
tmp=0
if n%2==1:
    ans=0
    print(ans)
else:

    r=1
    ans=0
    k=n
    while 10*r < n:
        ans+=(n//(10*r))
        r*=5
    print(ans)
#print(double_fac(n))

Submission status: Wrong Answer

Solution code:
N=int(input())
if N%2==0:
  cnt = N//10
  div = 50
  while N>div:
    cnt += (N//div)
    div *= 5
  print(cnt)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
from math import floor

n = int(input())
if n % 2 == 1:
    print(0)
else:
    num = 10
    ans = 0
    while num < n:
        ans += floor(n / num)
        num *= 5
    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n % 2:
    print(0)
else:
    ans = 0
    i = 1
    while (2 * (5 ** i)) < n:
        ans += n // (2 * (5 ** i))
        i += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
from math import floor
n = int(input())
if n % 2 != 0:
  print(0)
  exit()

x = 10
ans = 0
while x <= n:
  ans += floor(n/x)
  x *= 5

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
if n%2 != 0:
  print(0)
  exit()

x = 10
ans = 0
while x < n:
  ans += math.floor(n/x)
  x *= 5
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=1
while N>=2:
    ans=ans*N
    N-=2
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=1
while N>=2:
    ans*=N
    N-=2
print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def input():
    return sys.stdin.readline().rstrip('\n')

##### main

#N,T = list(map(int, input().split()))
N = int(input())

def nrof_divided_by(n, d):
    return n//d

def ndiv_list(n, d):
    l = []
    for i in range(n):
        _d = d**(i+1)
        if _d > n:
            break
        l.append(n//_d)
    return l
    
nrof_factor10 = ndiv_list(N//2,10)
nrof_factor5 = ndiv_list(N//2,5)
nrof_factor2 = ndiv_list(N//2,2)

if N % 2 == 1:
    print(sum(nrof_factor10))
else:
    print(sum(nrof_factor5))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def input():
    return sys.stdin.readline().rstrip('\n')

##### main

#N,T = list(map(int, input().split()))
N = int(input())

def nrof_divided_by(n, d):
    return n//d

def ndiv_list(n, d):
    l = []
    for i in range(n):
        _d = d**(i+1)
        if _d > n:
            break
        l.append(n//_d)
    return l
    
nrof_factor10 = ndiv_list(N//2,10)
nrof_factor5 = ndiv_list(N//2,5)

print(sum(nrof_factor5))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

ans = 0
for i in range(0, 26):
    ans += N // (5 ** i * 10)

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())

if N%2==0:
    n=N//2
    total=0
    for i in range(n):
        total+=i//5
    print(total)
elif N%2==1:
    print(0)

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
if N%2==1 or N==0:
    print(0)
else:
    v=0
    n=int(math.log(N,5))
    for i in range(n):
        k=i+1
        m=int(N/(pow(5,k)*2))
        v+=m
    print(v)

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
if N%2==1 or N==0:
    print(0)
else:
    v=0
    n=int(math.log(N,5))
    for i in range(n):
        k=i+1
        m=int(N/(pow(5,k)*2))
        
    print(v)

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
if N%2==1 or N==0:
    print(0)
else:
    v=0
    n=int(math.log(N,5))
    for i in range(n):
        k=i+1
        m=int(N/(pow(5,k)))
        v+=int(m/2)
    n=int(math.log(N,2))
    r=0
    for i in range(n):
        k=i+1
        m=int(N/(pow(2,k)))
        r+=m
    if m>=v:
        v=m
    print(v)

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
if N%2==1 or N==0:
    print(0)
else:
    v=0
    n=int(math.log(N,5))
    for i in range(n):
        k=i+1
        m=int(N/(pow(5,k)))
        v+=int(m/2)
    print(v)

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
if N%2==1 or N==0:
    print(0)
else:
    v=0
    n=int(math.log(N,5))
    for i in range(n):
        k=i+1
        m=N//(pow(5,k))
        v+=int(m/2)
    print(v)
    x=1

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# hello worldと表示する
#dpでできないかな？
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

n=I()
ans=0
if n%2==1:
    ans=0
else:
    for i in range(40):
        ans+=floor(n/(2*5**(i+1)))
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# hello worldと表示する
#dpでできないかな？
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

n=I()
ans=0
if n%2==1:
    ans=0
else:
    for i in range(40):
        ans+=int(n/(2*5**(i+1)))
print(ans)

Submission status: Wrong Answer

Solution code:
# ABC148 E Double Factorial

n = int(input())

if n % 2 == 1:
    print("0")
else:
    _list = [0] * 18
    for i in range(18):
        _list[i] = n // (10**(i+1))
    print(sum(_list))