Factorial trailing digits
I like this problem. At first glance, it seems impossible to solve the problem since there are too many trailing zeroes for factorial(10^12). Then I took a look at my old code. I managed to get rid of all those 2 and 5 in the code. It works pretty good. Only 4 ms needed to solve this problem.
No comments:
Post a Comment