比赛 |
20161116 |
评测结果 |
AAAWWWWWWW |
题目名称 |
删除他们! |
最终得分 |
30 |
用户昵称 |
夕见ai |
运行时间 |
0.039 s |
代码语言 |
C++ |
内存使用 |
0.29 MiB |
提交时间 |
2016-11-16 10:04:16 |
显示代码纯文本
//调了半天,发现这道题的判断没有想象中的复杂……代码缩减一半。
//2016.11.16
#include<cstdio>
using namespace std;
int n,m,t,s,p,q;
void del(){
int x1,y1,x2,y2;
scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
int i,j;
for(i=x1;i<=x2;i++){
for(j=y1;j<=y2;j++){
if(i<p-1){
s--;
continue;
}
if(i==p-1){
if(j<q){
s--;
continue;
}
}
}
}
p=s/m+1;
q=s%n+1;
}
int main(){
freopen("deleteit.in","r",stdin);
freopen("deleteit.out","w",stdout);
scanf("%d%d%d",&n,&m,&t);
s=n*m;
p=n,q=m;
int i;
for(i=0;i<t;i++)del();
printf("%d",s);
return 0;
}