广搜,,
hash[x][y][step%k]记录x,y位置step%k这种情况走过没有
#include<stdio.h>
#include<queue>
#include<string.h>
using namespace std;
char map[110][110];
int n,m,k,hash[110][110][11];
int sx,sy,ex,ey;
int dir[4][2]={0,1,1,0,0,-1,-1,0};
struct op
{
int x,y,step;
}cur,next;
int judge(int x,int y)
{
if(x>=0&&x<n&&y>=0&&y<m)
return 1;
return 0;
}
int bfs()
{
int i,j,x,y,step;
queue<op>Q;
cur.ste......
阅读全文