Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Zeros end of a number is made by multiplies of 2 and 5. So the number of zeros at the end of 100! is minimum value between the number of 2 in 100! and the number of 5 in 100! . And we can get this by getting min ( [100 div 2] + [100 div 4] + … + [100 div 64], [100 div 5] + [100 div 25]).
- [100 div 5] + [100 div 25] =20 + 4 = 24.
- [100 div 2] + [100 div 4] + … + [100 div 64] = 50 + 25 + 12 + … + 1 and it is much bigger than 24.
- So the answer is 24.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement