Sort 10 Discussions, By:
Please Login in order to post a comment
Wikipedia has a long article about this problem:
I finally got my solution to work. It was taking too long on the last two cases. Turns out that manual calculation was faster than using python's fractions library.
Is there a way for you to see the time taken by your code in each test case? I am a noobie and I like to know how fast the computer can crunch the numbers.
why this problem has been tagged as "Easy"??
when D = 61, it looks like the minimal x is 1766319049. It is really too crazy to iterator until this digit