众所周知,BFS是一个既简单有实用的算法。有一道very经典的BFS题:
luoguP1443马的遍历
#include<bits/stdc++.h>
#define N 405
using namespace std;
int n, m;
int x, y;
int a[N][N];
bool flag[N][N];
const int dx[] = {
-1, -2, -2, -1, 1, 2, 2
众所周知,BFS是一个既简单有实用的算法。有一道very经典的BFS题:
luoguP1443马的遍历
#include<bits/stdc++.h>
#define N 405
using namespace std;
int n, m;
int x, y;
int a[N][N];
bool flag[N][N];
const int dx[] = {
-1, -2, -2, -1, 1, 2, 2