题意:告诉每个矩形的边长,它们是紧贴着的,问从上往下看,有几个还能看到。
分析:用网上猥琐的方法,将边长看成左端点到中心的距离,这样可以避免精度问题。然后先求出每个矩形的左右端点,然后如果被覆盖那么将端点更新到被覆盖的位置。最后看那些更新后左端点小于右端点,这些是可以看得到的。
/************************************************* Author :Running_Time* Created Time :2015/10/28 星期三 11:48:32* File Name :POJ_3347.cpp ************************************************/#include #include #include #include #include #include #include #include #include #include #include #include #include