谁帮忙解释一下这道题,一道ACM的题

xyq1986 2006-02-14 06:05:12
specialist in VLSI design testing must decide if there are some components that cover each other for a given design. A component is represented as a rectangle. Assume that each rectangle is rectilinearly oriented (sides parallel to the x and y axis), so that the representation of a rectangle consists of its minimum and maximum x and y coordinates.

Write a program that counts the rectangles that are entirely covered by another rectangle.

The input contains the text description of several sets of rectangles. The specification of a set consists of the number of rectangles in the set and the list of rectangles given by the minimum and maximum x and y coordinates separated by white spaces, in the format:

nr_rectangles
xmin1 xmax1 ymin1 ymax1
xmin2 xmax2 ymin2 ymax2

xminn xmaxn yminn ymaxn

The output should be printed on the standard output. For each given input data set, print one integer number in a single line that gives the result (the number of rectangles that are covered). An example is given in Figure 1.


Input

3
100 101 100 101
0 3 0 101
20 40 10 400
4
10 20 10 20
10 20 10 20
10 20 10 20
10 20 10 20

Output

0
4
能讲解一下题意吗?
...全文
227 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
xyq1986 2006-02-17
  • 打赏
  • 举报
回复
那我怎么老超时啊?时间限制是7s,我还超时,不知怎么回事,我的时间复杂度是O(n^2)
galois_godel 2006-02-16
  • 打赏
  • 举报
回复
是阿
xyq1986 2006-02-14
  • 打赏
  • 举报
回复
0 3 0 101应该就是x=0,x=3,y=0,y=101所围成的矩形吗?
galois_godel 2006-02-14
  • 打赏
  • 举报
回复
求被完全覆盖的矩形个数阿

33,028

社区成员

发帖
与我相关
我的任务
社区描述
数据结构与算法相关内容讨论专区
社区管理员
  • 数据结构与算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧