Comments
On liaoyanxucheating?, 2 years ago
0

because you're doing 2nlog(n) queries, try to check the edges only for j in your function and forget about i (because 1 is your root and you'll eventually get his edges from the other nodes). also remember to change your conditional at the end. here's the submission i made with your code 277556024

ps: sorry for bad english

On liaoyanxucheating?, 2 years ago
+16

you've got to be kidding