题解【求点赞】
2025-09-22 20:45:02
发布于:浙江
2阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,m;
cin>>n>>m;
int a[1010][1010];
int b[11][11];
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
{
cin>>a[i][j];
}
}
for(int i=1;i<=3;i++)
{
for(int j=1;j<=3;j++)
{
cin>>b[i][j];
}
}
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
{
if(a[i][j]==b[1][1] && a[i+1][j]==b[2][1] && a[i+2][j]==b[3][1] && a[i+1][j+1]==b[2][2] && a[i+2][j+1]==b[3][2] && a[i][j+1]==b[1][2] && a[i][j+2]==b[1][3] && a[i+1][j+2]==b[2][3] && a[i+2][j+2]==b[3][3])
{
cout<<"YES";
return 0;
}
}
}
cout<<"NO";
return 0;
}
这里空空如也
有帮助,赞一个