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

Автор just_a_smallfry, история, 11 месяцев назад, По-английски

This 214966378 is the code i'm getting wrong answer for.

I've added comments too..for ease. But a quick overview — For numbers <= n , i'm making a different list (since trap cannot be set after n) , then sorting it, and iterating by calculating the divisors present till index i and setting final_answer as the maximum of those. Would be happy if somebody could help. Thanks!

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

»
11 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

After the sieve, sieve[i] for all prime numbers i will be 0. So, to fix it, for all prime_numbers, sieve[i] = i.