搜索讲座第二讲.pptxVIP

  • 1
  • 0
  • 约2.8千字
  • 约 14页
  • 2016-12-03 发布于河南
  • 举报
搜索讲座第二讲

-------搜索专题讲座 ACM新人培训计划Beijing Jiaotong U.ACM / ICPChdu 1010Tempter of the Bone4 4 5S . X .. . X .. . X D. . . .3 4 5S . X .. . X .. . . D0 0 0X: a block of wall, which the doggie cannot enter;?S: the start point of the doggie;?D: the Door; .: an empty block.Dfsvoid dfs(int x,int y){ int i,dx,dy; if(time=t) return; used[x][y]=true; for(i=0; i4; i++) { if(flag)return; dx=x+dir[i][0]; dy=y+dir[i][1]; if(!check(dx,dy)||used[dx][dy]) continue; if(a[dx][dy]==.) { time++; dfs(dx,dy); time--; used[dx][dy]=false; } if(a[dx][dy]==Dtime+1==t) flag=true; }}4 4 5S . X .. . X .. . X D. . . .3 4 5S . X

文档评论(0)

1亿VIP精品文档

相关文档