程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程解疑 >> components-Rectangles

components-Rectangles

編輯:編程解疑
Rectangles

描述 :

A 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

For each set,there will be less than 5000 rectangles.

輸出:

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).
樣例輸入:

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
樣例輸出:

0
4

最佳回答:


http://blog.csdn.net/mobius_strip/article/details/8299946

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved