ZEROSProblem code: EMA01 |
To find the zeroes in a factorial of a number. In this problem, we have to find the number of zeroes following a non negative number in a factorial of a number. Suppose the number entered is 6 and we know factorial of 6 is 720 thus there is only one zero after a non- negative number, so the output is 1.
Input
The first number N indicates the number of test cases to be followed.It stands for number of numbers to be followed. Then there are N lines each containing exactly one positive integer for which the solution to be found out.
Output
For every number, output a single line containing the single non negative integer.
Example
Input:Sample Input 6 3 60 100 1024 23456 8735373 Output: 0 14 24 253 5861 2183837
| Author: | rajneeshrana |
| Date Added: | 25-03-2010 |
| Time Limit: | 1 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, ERL, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TEXT, WSPC |
Comments

Fetching successful submissions

wat is constraint on
wat is constraint on input
wat it mean
"output a single line containing the single non negative integer."
is it no. zeros
@Admin: Can't submit the
@Admin: Can't submit the solution.... :(
help
LOL .. cant submit solution
LOL .. cant submit solution ... and the contest ends in 1 day
why is my solution giving TLE
why is my solution giving TLE when it has already been accepted on other judges??
@Suyash It is giving TLE as
@Suyash
It is giving TLE as this judge does not have any test data and so keeps on waiting for the program to terminate while the program is waiting for input data
@Admin
Is any registration needed for this contest?
@admin I made a program in c
@admin
I made a program in c (using gcc in ubuntu linux)
Its workin fine till input value 13 due to variable data type unable to store such a long no.
i am using unsigned long.
i hav P4 2.40 GHz processor 32 bit PC...
please help me which data type should i use? or will it b fine with unsigned long on ur(judge's PC)
plz reply fast....
@Manohar : Datatype is not a
@Manohar : Datatype is not a concern here, 'int' should be fine too.. change your approach. Finding n! and counting zeroes in it, is not gonna work.
@Akash Mehrotra I don't think
@Akash Mehrotra
I don't think that there are no test cases becoz ultimately my real solution was accepted (I did not submit any empty function for this problem). I think there is some other error because of which the empty functions are always accepted and the original code gets accepted in several tries if you are lucky!!
There's something wrong with
There's something wrong with the time limit.Even an empty function exceeds TLE.
Do not take any input and it
Do not take any input and it gets AC.Its just ridiculous!