Ad
  • Custom User Avatar

    The test quality is poor; it's 50 random tests of n < 1e6 along with n = 0, 1, 1e8. The original code can pass the tests once it returns the correct answer for n = 1e8 without trying to compute it.

    But then bumping the input range of random tests will also cause timeouts. Not even the faster solution finishes all the tests if the 50 random tests are bumped to n < 1e7.

  • Custom User Avatar

    10e6 and 10**6 ( and same for 8 ) are not the same thing.