比赛 |
20161116 |
评测结果 |
AAAAAAAAAA |
题目名称 |
删除他们! |
最终得分 |
100 |
用户昵称 |
iortheir |
运行时间 |
0.162 s |
代码语言 |
C++ |
内存使用 |
1.27 MiB |
提交时间 |
2016-11-16 11:08:11 |
显示代码纯文本
#include<iostream>
#include<cstdio>
using namespace std;
const int maxn = 100 + 10;
const int maxm = 1000000 + 100;
int n;
int m;
int q;
int x;
int x1;
int y;
int y1;
int cnt = 0;
bool Ais[maxm] = {0};
int kount;
int main()
{
freopen("deleteit.in","r",stdin);
freopen("deleteit.out","w",stdout);
scanf("%d%d%d",&n,&m,&q);
cnt = n * m;
for(int t = 0;t < q ;t ++)
{
scanf("%d%d%d%d",&x,&y,&x1,&y1);
for(int i = x;i <= x1 ;i ++)
{
int u = i * m;
for(int j = y;j <= y1 ;j ++)
{
Ais[u + j] = 1;
}
}
kount = 0;
for(int i = 0;i < cnt ;i ++)
{
if(Ais[i] == 0)
{
Ais[kount ++] = 0;
}
}
cnt = kount;
}
cout<<kount;
return 0;
}