Posted on 2008-04-23 13:05
superman 阅读(234)
评论(0) 编辑 收藏 引用 所属分类:
ZOJ
1 /* Accepted 1139 C++ 00:04.99 900K */
2 #include <iostream>
3
4 using namespace std;
5
6 struct Rectangle
7 {
8 int x1, y1, x2, y2;
9 };
10
11 int main()
12 {
13 int n;
14 while(cin >> n)
15 {
16 Rectangle * rect = new Rectangle[n];
17
18 for(int i = 0; i < n; i++)
19 cin >> rect[i].x1 >> rect[i].x2 >> rect[i].y1 >> rect[i].y2;
20
21 int cnt = 0;
22 for(int i = 0; i < n; i++)
23 for(int j = 0; j < n; j++)
24 if(i != j)
25 if(rect[i].x1 >= rect[j].x1 && rect[i].y1 >= rect[j].y1)
26 if(rect[i].x2 <= rect[j].x2 && rect[i].y2 <= rect[j].y2)
27 {
28 cnt++;
29 break;
30 }
31 cout << cnt << endl;
32
33 delete [] rect;
34 }
35
36 return 0;
37 }
38