TLE with an O(n sqrt(n))

Правка en1, от proofbycontradiction, 2018-12-06 10:50:51

I was solving this interesting number-theory + trees problem. And I came up with an solution where n ≤ 200000.

My idea is that the answer for every node will either be a factor of the root or be a factor of the number itself, and only these about values need to be tested.

The solution in the e

Теги c++, number theory, trees, optimization

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский proofbycontradiction 2018-12-06 11:06:47 214 (published)
en2 Английский proofbycontradiction 2018-12-06 10:57:24 814
en1 Английский proofbycontradiction 2018-12-06 10:50:51 411 Initial revision (saved to drafts)