解题思路:
这题一看到,卧槽,好简单,无脑dfs就可以走完,于是不到5分钟码出来了个dfs,没想到光荣的T了,,,然后翻了翻题解,才知道要用棋盘dp,以前一直不会,现在就来学学吧。
T的代码:
# include<cstdio>
# include<iostream>
using namespace std;
# define MAX 20
int grid[MAX][MAX];
int vis[MAX][MAX];
int edx,edy;
int mx,my;
int res;
int next[2][2] = { {0,1},{1,0} };
int next2[9][2] = { {0,0},{-1,-2},{-1,2},{-2,-1},{-2,1},{1,-2},{1,2},{2,-1},{2,1} };
int judge ( int x,int y )
{......
阅读全文