Sort 12 Discussions, By:
Please Login in order to post a comment
I solved the problem properly for all testcases, but it timed out for a single Testcase which took 13 secs on my machine. I am clueless about the kind of datastructure to select for this problem. But great problem to solve!
I think,it can be solved using only disjoint set data structure,without any binary search.Although I got wrong answers in 2 test cases.
Russian translation has mistake in the output format description
Should be 'for every color', not 'for every edge'
Did anyone manage to solve it in Python? Getting timeout for single TC...
I can't see any use for the "m" in the inputs .. am I wrong ??