Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register

## 这是个大水！

Posted by KatrineYang at 2016-09-03 00:51:39 on Problem 1262
```#include <iostream>
#include <stdio.h>
using namespace std;

int main() {
int T;
scanf("%d", &T);
for(int ii = 0; ii < T; ii++){
int x, y;
scanf("%d%d", &x, &y);
int xl[110], yl[110], xh[110], yh[110];
int gs;
scanf("%d", &gs);
bool inside = 1;
bool disjoint = 1;
long long int area = 0;
for(int i = 0; i < gs; i++){
scanf("%d%d%d%d", &xl[i], &yl[i], &xh[i], &yh[i]);
if(xl[i]<0 || yl[i]<0 || xh[i]>x || yh[i]>y) inside = 0;
area += (xh[i]-xl[i])*(yh[i]-yl[i]);
}
for(int i = 0; i < gs-1; i++){
for(int j = i+1; j < gs; j++){
if(xh[i]>xl[j] && xh[j]>xl[i] && yh[i]>yl[j] && yh[j]>yl[i]){
disjoint = 0;
goto done;
}
}
}
done:
if(!disjoint){
printf("NONDISJOINT\n");
}
else if(!inside){
printf("NONCONTAINED\n");
}
else if(area != x*y){
printf("NONCOVERING\n");
}
else{
printf("OK\n");
}
}
return 0;
}
```

Followed by: