#include #include #include using namespace std; int N,M; char map[110][20],num[70],top; int stk[70],cur[70]; int dp[110][70][70]; bool check(int x){//判断该状态是否合法,横向检测相邻的1之间的距离不能小于3 if(x&(x<<1)) return 0; if(x&(x<<2)) return 0; return 1; } void init(){//记录所有可能的合法状态,最多60种 top=0; for(int i=0;i<(1<