Sort 10 Discussions, By:
Please Login in order to post a comment
It is not given if the tree is binary or non binary. I wrote the code for non binary tree and now it is giving time limit exceeded error. Shall I assume it to be binary tree?
How to connect them. What is the head of what? What are the sub-nodes of each node?
Can a node have two heads?
Submission failed with test case 3, but copy the data into customerized test passed.
The 4th line of output should be -1487 instead of 1213 ?
Can anyone help me?
Hey guys i solved the problem using heavy light decomposition incorporating segment tree lazy propagation .
I managed to secure 112.5/120 point . (with 47/50 test cases passed)
just three test cases aborted due to i assume because of memory limits
i again wrote quite well long commented/documented code wchin you can find on submissions abhishek's submsission commented/documented code wchin you can find on submissions [(https://www.hackerrank.com/challenges/subtrees-and-paths/submissions/code/202527244)
I have a problem with how the trees are constructed. How do we determine which nodes are children?
In test case 1, the input is given as such:
For row "10 9", are we supposed to infer from the existence of node9 and its label that 10 is a child of 9?