Python Forum
Help making this code not TLE
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help making this code not TLE
#2
Okay, so there is a trick here.  You can't purely brute force this.

The trick is, after a certain point any factorial mod 2**32 is 0.
So if the number is bigger than that you just return 0 without doing any calculation.

Take a shot at figuring out what that number is.
Reply


Messages In This Thread
Help making this code not TLE - by Ilikebugs - Dec-21-2017, 12:53 AM
RE: Help making this code not TLE - by Mekire - Dec-21-2017, 03:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Star I was making code for collision for my character izmamonke 2 2,111 Aug-06-2021, 04:30 PM
Last Post: izmamonke
  Making a code.py file to function, does not run hobbyist 6 2,959 Jan-27-2021, 07:50 AM
Last Post: DeaD_EyE
  Making new lines of code AvioxyYT 1 1,834 Jan-22-2021, 07:02 PM
Last Post: buran
  making the code easier, list comprehension go127a 2 2,087 May-26-2019, 06:19 PM
Last Post: Gribouillis
  [split] I need help making a four digit code cracker with random tycpytyt 1 2,573 Mar-24-2019, 05:53 PM
Last Post: micseydel
  Making a Easy Password/code system nmsturcke 4 3,889 Jul-09-2018, 02:50 AM
Last Post: ichabod801
  Need help making code more efficient dhbergen 5 3,917 Apr-17-2018, 01:00 AM
Last Post: dhbergen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020