Getting tle in using Common segtree in HLD, but not in Different segtree for each heavy path

Правка en1, от shashankagrawal, 2020-07-16 01:15:55

Can any one help me with why this solution is getting TLE, are the constants too high? My solution is here in which I made single segment tree for whole of the tree And the one which got AC, in which I made different segtree for each heavy path, is here

Теги heavy light, #segment-trees, #trees

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский shashankagrawal 2020-07-17 01:58:04 64 Tiny change: '/86944276)' -> '/86944276)\n\nEdit :- Got it now, Thanks to [user:bessiethecow]'
en1 Английский shashankagrawal 2020-07-16 01:15:55 463 Heavy Light Decomposition, Trees, Segment Tree (published)