线段树-面积并

  • Post author:
  • Post category:其他


第一次学这个的时候,说实话很头疼,看别人写的文章也学不会,花了一下午才有了些头绪。所谓的面积并,就是求多个矩形相交的面积或者求不相交部分的面积。这类问题要用到一个概念,叫做“扫描线”。刚开始完全看不懂,觉得自己太笨了。刚练习时的时候,我是做的一道杭电上的题目。

HDU 1542

Atlantis

Problem Description
There are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, these maps describe different regions of Atlantis. Your friend Bill has to know the total area for which maps exist. You (unwisely) volunteered to write a program that calculates this quantity.


Input

The input file consists of several test cases. Each test case starts with a line contai



版权声明:本文为YZS_L_H原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。