complexity analysis help

Revision en3, by 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://mirror.codeforces.com/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

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English Uzumaki_Narutoo 2020-05-08 20:28:52 345
en3 English Uzumaki_Narutoo 2020-05-08 20:20:24 305
en2 English Uzumaki_Narutoo 2020-05-08 19:24:34 6 Tiny change: 'ng great\ncan any on' -> 'ng great\n.... can any on'
en1 English Uzumaki_Narutoo 2020-05-08 19:23:33 199 Initial revision (published)