AcWing 4510. 寻宝!大冒险!csp25(2)
原题链接
简单
作者:
YAX_AC
,
2024-12-06 16:50:31
,
所有人可见
,
阅读 7
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
const int N = 1010;
int n,L,s;
int a[N][N],b[N][N];
int x[N],y[N];
int main()
{
scanf("%d%d%d",&n,&L,&s);
for(int i = 0; i<n; i++) scanf("%d%d",&x[i],&y[i]);
for(int i = s; i>=0; i--)
for(int j = 0; j<=s; j++)
scanf("%d",&b[i][j]);
int ans = 0;
for(int k = 0; k<n; k++)
{
memset(a,0,sizeof a);
for(int i = 0; i<n; i++)
{
if(x[i]>=x[k] && x[i]<=s+x[k] && y[i]>=y[k] && y[i]<= s+y[k])
a[x[i]-x[k]][y[i]-y[k]] = 1;
}
int flag = 1;
for(int i = 0; i<=s; i++)
for(int j = 0; j<=s; j++)
{
if(a[i][j]!=b[i][j] || x[k]+i>L || y[k]+j > L)
{
flag = 0;
break;
}
}
ans+=flag;
}
printf("%d",ans);
return 0;
}
你真棒❤️
宝贝,么么哒,我爱你❤️
ε٩(๑> ₃ <)۶з