Ad
  • Custom User Avatar

    Hint: You're not meant to calculate the factorial. Find another way to find the number of zeros.

    n=1000000000 in one of the tests. Calculating the factorial of this number will take an incredible amount of time no matter how fast your computer is. This means this isn't possible to calculate it - try another approach without trying to calcuate the factorial. Hint: try to find a pattern between each factorial.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Same here. My code passes the tests (I added a couple more, including for 100!), but fails on submit with a timeout after 7000 ms. I checked it on my PC with time.clock() on a loop from 1! to 100! and the result was few miliseconds.