Блог пользователя serasesi

Автор serasesi, история, 8 лет назад, По-английски

Hi, I was solving POP1 but can't get it to pass under the time limit.

Things I've tried.

  1. For detecting pop numbers, I simply brute force.
  2. For checking primes, I maintain an array of primes till 2e7 and after that apply Miller-Rabbin.

Here is my code.

  • Проголосовать: нравится
  • +2
  • Проголосовать: не нравится

»
8 лет назад, скрыть # |
Rev. 8  
Проголосовать: нравится -14 Проголосовать: не нравится

First of all you can try to use linear prime sieve. Secondly, are you sure that your while does not work too long?

this while