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

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

Facing a lot of difficulty in solving this problem from a long time. Problem Link-SAS002. Naive approach O(sqrt(n)) clearly times out. How to solve this problem in given time limit and what is the intended time complexity of the algorithm? Thought about finding number of divisors in O(n^(1/3)) and using that, after some research.Is that correct approach?

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

»
6 лет назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Yes, it seems to be the correct approach. This blog describes how to count number of divisors of a a number in

Unable to parse markup [type=CF_TEX]

and this gives a proof that product of all divisors of N is

Unable to parse markup [type=CF_TEX]

where d is the number of divisors of N.
»
6 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Nice problem! Thanks for sharing.