Project Euler Question 3 Help

后端 未结 16 1388
攒了一身酷
攒了一身酷 2020-12-08 08:25

I\'m trying to work through Project Euler and I\'m hitting a barrier on problem 03. I have an algorithm that works for smaller numbers, but problem 3 uses a very, very large

16条回答
  •  感动是毒
    2020-12-08 09:13

    Try using the Miller-Rabin Primality Test to test for a number being prime. That should speed things up considerably.

提交回复
热议问题