Trailing Zeros!
Practice
5 (1 votes)
Easy
Number theory
Problem
93% Success 428 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

You are given N elements of an array. You need to find number of trailing zeros in the product of all these N elements.

Trailing zeros are a sequence of 0 in the decimal representation (or more generally, in any positional representation) of a number, after which no other digits (except 0) follow.

Example. Trailing zeros : 3 in 101000 , 2 in 10200, 0 in 2132, 0 in 10011.

Input Format:

First line contains N, total number of elements.

Second line contains N space separated integers A[i]s.

Output Format:

Print the only integer indicating number of trailing zeros in the product of all elements.

Constraints:

1<=N<=100000

1<=A[i]<=10^9

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
210 votes
Tags:
Basic ProgrammingSimple-mathEasy
Points:20
11 votes
Tags:
Basic ProgrammingOpenApprovedEasyMathamatics
Points:20
1 votes
Tags:
Easy
Editorial

No editorial available for this problem.