模拟他给的方向走,判断一个循环即可
1 #include2 #include 3 using namespace std; 4 int dx[5]={ 0,0,1,0,-1}; 5 int dy[5]={ 0,1,0,-1,0}; 6 char s[1000]; 7 int map[1000][1000]; 8 int flag[1000][1000]; 9 bool lop;10 int n,m,k,x,y,t;11 bool check(int const &x,int const &y)12 {13 return 0<=x&&x <=y&&y