比赛 20161116 评测结果 AAAAAAAAAA
题目名称 删除他们! 最终得分 100
用户昵称 BIRD 运行时间 0.161 s
代码语言 C++ 内存使用 1.27 MiB
提交时间 2016-11-16 12:09:52
显示代码纯文本
#include<iostream>
#include<cstdio>
 
using namespace std;
 
const int maxn = 100 + 10;
 
const int maxm = 1000000 + 100;
 
int n,m,q,x,x1,y,y1,brd=0;

bool orz[maxm] = {0};
 
int bird;
 
int main()
{
	freopen("deleteit.in","r",stdin);
	freopen("deleteit.out","w",stdout);
	scanf("%d%d%d",&n,&m,&q);brd = 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 ++){
				orz[u + j] = 1;
			}
		}bird = 0;
		for(int i = 0;i < brd ;i ++){
			if(orz[i] == 0){
				orz[bird ++] = 0;
			}
		}brd = bird;
	}
	cout<<bird;
	return 0;
}