hiho week 140 register

Ended

Participants:351

Verdict:Accepted
Score:100 / 100
Submitted:2017-03-04 20:33:26

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <cstdio>
#include <algorithm>
using namespace std;
const int MAXN = 1005;
int W, H, N;
struct Rect {
    Rect() {cntReachable = 0;}
    int x1, y1, x2, y2, cntReachable;
    int reachable[32];
}r[MAXN];
bool intersect(const Rect &A, const Rect &B) {
    return max(A.x1, B.x1) < min(A.x2, B.x2) && max(A.y1, B.y1) < min(A.y2, B.y2);
}
bool notCovered(int x, int y, int id) {
    for (int i = id + 1; i <= N; ++i)
        if (x > r[i].x1 && x < r[i].x2 && y > r[i].y1 && y < r[i].y2) return false;
    return true;
}
bool canRemove(int id) {
    return notCovered(r[id].x1, r[id].y1, id) || notCovered(r[id].x1, r[id].y2, id)
        || notCovered(r[id].x2, r[id].y1, id) || notCovered(r[id].x2, r[id].y2, id);
}
int main() {
    scanf("%d%d%d", &W, &H, &N);
    for (int i = 1; i <= N; ++i) {
        scanf("%d%d%d%d", &r[i].x1, &r[i].y1, &r[i].x2, &r[i].y2);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX