RE求调,玄关
查看原帖
RE求调,玄关
1329354
Johnson31楼主2025/6/12 21:37
#include<bits/stdc++.h>
using namespace std;
int t,x,y,c[110][110],aim[4][4]={{'0','0','0','0'},
                                 {'0','1','1','0'},
                                 {'0','1','1','0'},
                                 {'0','0','0','0'}};
bool flag=0;
bool check(int x,int y){
    for(int i=0;i<4;i++){
        for(int j=0;j<4;j++){
            if(c[i+x][j+y]!=aim[i][j]){
                return 0;
            }
        }
    }
    return 1;
}
int main(){
	cin>>t;
    while(t--){
        cin>>x>>y;
        for(int i=1;i<=x;i++){
            for(int j=1;j<=y;j++){
                cin>>c[i][j];
            }
        }
        for(int i=1;i<=x-3;i++){
            for(int j=1;j<=y-3;j++){
                if(check(i,j)){
                    flag=1;
                    break;
                }
            }
        }
        if(flag)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
        flag=0;
    }
	return 0;
}
2025/6/12 21:37
加载中...