BFS,先到达即停止。
//因为奇葩的内网而无故CE不止
/*This Code is Submitted by Iris for Problem 1440 at 2013-07-24 22:46:09*/
#include <queue>
#include <cstdio>
#include <cstring>
#include <string>
using namespace std;
int move[8][2] = {{-2,1},{-1,2},{1,2},{2,1},{-2,-1},{-1,-2},{1,-2},{2,-1}};
typedef struct point{int x,y,step;}point;
int main()
{
char str[10];
while(gets(str)){
int map[8][8];
memset(map,-1,sizeof(map));
int r1,c1,r2,......
阅读全文