Graph connectivity problem: efficient solution?

Revision en1, by Al.Cash, 2015-06-28 23:53:10

I solved the following problem http://acm.timus.ru/problem.aspx?space=1&num=2055 using approach described here http://codeforces.me/blog/entry/15296 + binary search, but my solution barely fits in Time Limit.

There are solutions 10 times faster than mine and I'm very interested what approach could they be using?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Al.Cash 2015-06-28 23:53:10 364 Initial revision (published)