
扫描线
Error Man
我是菜逼
展开
-
HDU 1255(线段树 + 离散化 + 扫描线)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1255思路: 与扫描线求面积并类似。在面积并的基础上 多增加一个 sum2[] 数组,存放覆盖两次及以上的投影。具体看代码AC代码:#include<cstdio>#include<algorithm>#include<cstring>using ...原创 2018-07-26 22:33:49 · 229 阅读 · 0 评论 -
HDU 1542(线段树 + 离散化 + 扫描线)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1542题意: 给你n个矩形的左上角顶点与右下角顶点, 求 n个矩形的面积和(可能重叠,重叠的部分只算一次)。思路: 扫描线模版题。关于扫描线建议看这个博客:http://www.cnblogs.com/scau20110726/archive/2013/04/12/3016765.html...原创 2018-07-26 20:08:50 · 274 阅读 · 0 评论