题目链接:
http://poj.org/problem?id=3083
中文题意:
表示这个人写比较清楚。。
http://www.cnblogs.com/lyy289065406/archive/2011/07/31/2122369.html
每次默认向上为刚开始的方向。
及其恶心的题,bfs加dfs
代码:
#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<string.h>
#include<queue>
using namespace std;
int ans1,ans2,dis[45][45],flag,T,n,m,f[45][45],opx,opy,edx,edy;
int der[2][4]={
{-1,0,1, 0},
{ 0,-1,0,1}};
struct node{
int x;int y;
};
char c[45