# 蒟蒻求助

@Simonzhang03022007 2020-02-14 19:04 回复


#include <cstdio>
using namespace std;
int wei[101][101]={};

int main(){
int n,m,k;
scanf("%d %d %d",&n,&m,&k);
for (int i=1;i<=m;i++){
int a,b;
scanf("%d %d",&a,&b);
wei[a][b]=1;
wei[a-2][b]=1;
wei[a-1][b-1]=1;
wei[a-1][b]=1;
wei[a-1][b+1]=1;
wei[a][b-2]=1;
wei[a][b-1]=1;
wei[a][b+1]=1;
wei[a][b+2]=1;
wei[a+1][b-1]=1;
wei[a+1][b]=1;
wei[a+1][b+1]=1;
wei[a+2][b]=1;
}
if (k>0){
for (int i=1;i<=k;i++){
int a,b;
scanf("%d %d",&a,&b);
wei[a-2][b-2]=1;
wei[a-2][b-1]=1;
wei[a-2][b]=1;
wei[a-2][b+1]=1;
wei[a-2][b+2]=1;
wei[a-1][b-2]=1;
wei[a-1][b-1]=1;
wei[a-1][b]=1;
wei[a-1][b+1]=1;
wei[a-1][b+2]=1;
wei[a][b-2]=1;
wei[a][b-1]=1;
wei[a][b]=1;
wei[a][b+1]=1;
wei[a][b+2]=1;
wei[a+2][b-2]=1;
wei[a+2][b-1]=1;
wei[a+2][b]=1;
wei[a+2][b+1]=1;
wei[a+2][b+2]=1;
wei[a+1][b-2]=1;
wei[a+1][b-1]=1;
wei[a+1][b]=1;
wei[a+1][b+1]=1;
wei[a+1][b+2]=1;
}
}
int sum=0;
int zhi=1;int er=1;
for (int i=1;i<=n*n;i++){
if (er>n){
zhi++;
er-=n;
}
if(wei[zhi][er]==0){
sum++;
printf("%d %d\n",zhi,er);
}
er++;

}
printf("%d",sum);
} 
@哈利_波特 2020-02-14 19:16 回复 举报