比赛 20161116 评测结果 AAAAAAAAAA
题目名称 删除他们! 最终得分 100
用户昵称 KZNS 运行时间 0.197 s
代码语言 C++ 内存使用 1.24 MiB
提交时间 2016-11-16 09:27:25
显示代码纯文本
//KZNS
#include <cstdio>
using namespace std;
bool mp[1000003];
int N, M, Q;
int S;
void work() {
    int X1, Y1, X2, Y2;
    scanf("%d %d %d %d", &X1, &Y1, &X2, &Y2);
    for (int i = X1; i <= X2; i++)
        for (int j = Y1; j <= Y2; j++)
            mp[i*M+j] = true;
    int lt = 0;
    for (int i = 0; i < S; i++)
        if (!mp[i])
            mp[lt++] = false;
    S = lt;
}
int main() {
    freopen("deleteit.in", "r", stdin);
    freopen("deleteit.out", "w", stdout);
    scanf("%d %d %d", &N, &M, &Q);
    S = N*M;
    for (int i = 0; i < Q; i++)
        work();
    printf("%d\n", S);
    return 0;
}
//UBWH