complexity analysis help

Правка en3, от Uzumaki_Narutoo, 2020-05-08 20:20:24

Hello every one ,wish you are doing great .... can any one explain how does this code doesn't got TLE ? https://codeforces.net/contest/246/submission/79394388

the nodes that are in distance k from node v are in depth = depth[v] + k let it d and using euler tour we can get the nodes which are in the subtree of v and also in depth d and to get the number of distinct strings I just made a set of strings and iterate over all nodes in the range and save it

thanks in advance

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский Uzumaki_Narutoo 2020-05-08 20:28:52 345
en3 Английский Uzumaki_Narutoo 2020-05-08 20:20:24 305
en2 Английский Uzumaki_Narutoo 2020-05-08 19:24:34 6 Tiny change: 'ng great\ncan any on' -> 'ng great\n.... can any on'
en1 Английский Uzumaki_Narutoo 2020-05-08 19:23:33 199 Initial revision (published)