题目来源:http://poj.org/problem?id=2049
题目描述:
Nemo被困在一个迷宫中,他的father Marlin准备去救他,迷宫有很多门,Marlin只能从门中过,问Marlin最少需要经过多少门才能找到Nemo.
题目分析:
题目描述很容易让人想起迷宫的题,其实基本思想是一样的,但是有一点比较重要就是:一个格子被访问过之后还能再被访问。但是这是满足最优前提下的。具体看代码吧
代码实现:
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
typedef struct
{
int x,y;
} Point;
int mat[201][201][2];
int step[201]