#include #include #include #include #include #include using namespace std; typedef long long ll; ll MOD = 1e9+7; int m[100][100]; int w,h; int dfs(int n,int x,int y,int sx,int sy,bool check[][100],int cnt) { check[y][x]=true; if(cnt>1) check[sy][sx]=false; if(x0 && m[y][x-1]==n && !check[y][x-1]) { if(x-1==sx && y==sy) return 1; else return dfs(n,x-1,y,sx,sy,check,cnt+1); } if(y>w>>h; for(int i=0;i>m[i][j]; } //それぞれの数字について探索する for(int n=1;n<1001;n++) { bool check[100][100]; //fill(check[0],check[100],false); //始点を探索する for(int i=0;i0) { cout<<"possible"<