City Park 题目连接: http://acm.hust.edu.cn/vjudge/contest/view.action?cid=122283#problem/F Description Porto is blessed with a beautiful city park. The park, in the western section of the city, borders the Atlantic Ocean. It has great lawns, small forest…
City Park Problem's Link: http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=129725 Mean: 在网格中给你一些矩形,求最大连通块的面积. analyse: 由于题目保证了矩形不会相交,所以不用扫描线也可做. 先把所有的线段分为横向和纵向,然后排序,依次判断是否相邻,相邻就用并查集合并,最后再用并查集统计一下面积,取最大值即可. Time complexity: O(N) Source code…