登录

最新会员 最新下载

成为了本站VIP会员

04月26日 23:14

成为了本站VIP会员

04月25日 21:33

成为了本站VIP会员

04月23日 14:46

成为了本站VIP会员

04月18日 20:09

成为了本站VIP会员

04月18日 18:37

成为了本站VIP会员

04月18日 18:25
已选条件
  1. 编程语言:Pascal
  2. 代码类别:其他游戏
  3. 发布时间:不限
全部撤销
编程语言 更多 收起
代码类别 更多 收起
发布时间
更多选项

1. 2

说明:  Background Given a set of rectangles {R1, R2, …, Rn}, compute the area of their common intersection. i.e., Area(R1∩R2∩…∩Rn) The edges of the rectangles R1, R2, …, Rn, are either vertical or horizontal lines. For example, the intersection of 4 rectangles, R1, R2, R3, and R4, in the following figure is the shaded rectangle. Input The input contains (N + 1) lines. The first line specifies the number of rectangles N, where 1 < N < 1000. Since the sides of the rectangles are parallel to the x-axis and y-axis, each rectangle is bounded by the lines x = x1, x = x2, y = y1 and y = y2 and each subsequent line of the input file thus specifies one rectangle in the following format: x1 x2 y1 y2 such that 0 <= x1 < x2 <= 10000 and 0 <= y1 < y2 <= 10000, and x1, x2, y1 and y2 are integers. Output The output file contains the area of the intersection of all the rectangles.

0
下载
132
浏览
2013-11-15发布

2. 2

  Background Given a set of rectangles {R1, R2, …, Rn}, compute the area of their common intersection. i.e., Area(R1∩R2∩…∩Rn) The edges of the rectangles R1, R2, …, Rn, are either vertical or horizontal lines. For example, the intersection of 4 rectangles, R1, R2, R3, and R4, in the following figure is the shaded rectangle. Input The input contains (N + 1) lines. The first line specifies the number of rectangles N, where 1 < N < 1000. Since the sides of the rectangles are parallel to the x-axis and y-axis, each rectangle is bounded by the lines x = x1, x = x2, y = y1 and y = y2 and each subsequent line of the input file thus specifies one rectangle in the following format: x1 x2 y1 y2 such that 0 <= x1 < x2 <= 10000 and 0 <= y1 < y2 <= 10000, and x1, x2, y1 and y2 are integers. Output The output file contains the area of the intersection of all the rectangles.

1
下载
133
浏览
2013-11-15发布