并查集 - PKU 2922 - Honeymoon Hike

http://www.cppblog.com/gdgzgq/articles/114365.html