why?
P1789 【Mc生存】插火把
为什么会RE?
#include<bits/stdc++.h>
using namespace std;
int a[105][105],n,m,k,x,y,cnt;
int main(){
cin>>n>>m>>k;
for(int i=1;i<=m;i++){
cin>>x>>y;
for(int i=x-1;i<=x+1;i++) for(int j=y-1;j<=y+1;j++) a[i][j]=true;
a[x-2][y]=true;
a[x+2][y]=true;
a[x][y+2]=true;
a[x][y-2]=true;
}
for(int i=1;i<=k;i++){
cin>>x>>y;
for(int i=x-2;i<=x+2;i++) for(int j=y-2;j<=y+2;j++) a[i][j]=true;
}
for(int i=1;i<=n;i++)for(int j=1;j<=n;j++) if(a[i][j]==0) cnt++;
cout<<cnt;
return 0;
}
点这里
请求dalao帮忙!!!