代码拉取完成,页面将自动刷新
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int a[105][105], z[5][5] = {{0, 0, 0, 0}, {0, 1, 1, 0}, {0, 1, 1, 0}, {0, 0, 0, 0}};
int main()
{
int t;
cin >> t;
while (t--)
{
int n, m, res = 0;
cin >> n >> m;
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= m; j++)
{
char c;
cin >> c;
a[i][j] = c - '0';
}
}
for (int i = 1; i + 3 <= n && !res; i++)
{
for (int j = 1; j + 3 <= m && !res; j++)
{
int ok = 1;
for (int x = 0; x < 4 && ok; x++)
{
for (int y = 0; y < 4 && ok; y++)
{
ok = (a[i + x][j + y] == z[x][y]);
}
}
res = max(res, ok);
}
}
cout << (res ? "Yes" : "No") << endl;
}
return 0;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。