- 博客(3)
- 资源 (5)
- 收藏
- 关注
原创 HDU 1372 Knight Moves(BFS)
HDU1372:Knight Moves(BFS)Problem DescriptionA friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visi
2014-12-18 23:15:29 518 1
原创 迷宫问题二 统计路径条数(dfs+回溯)
#includeusing namespace std;char maze[100][100];bool flag[100][100];int dx[]={0,0,1,-1};int dy[]={1,-1,0,0};int m,n;int sum=0;void dfs(int x,int y){ if(maze[x][y]=='T'){sum++;return ;} fo
2014-12-12 13:01:14 2372 1
原创 迷宫问题一 找到迷宫的一条路径(DFS+回溯)
问题描述:一天,小明不小心进入了一个迷宫,现在请你帮助他判断能否出走出迷宫,如果可能,则输出YES. 如果不能走到出口,则输出NO. 每次走只能是上下左右4个方向.*表示可走#表示障碍T表示出口入口是(1,1),数据保证左上角是入口#includeusing namespace std;char maze[100][100];bool flag[100][10
2014-12-11 23:35:23 4855 2
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人