vector<vector
vector<vector
开数组大小一定要超过题目本身大小;
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define P pair<int, int>
const int N = 1e3 + 10;
int x[9] = {-2, -1, 1, 2, 2, 1, -1, -2};
int y[9] = {-1, -2, -2, -1, 1, 2, 2, 1};
queue
qu;
vector<vector
signed main()
{
** int n, m;**
** cin >> n >> m;**
** int i, j;**
** cin >> i >> j;**
** qu.push({i, j});**
** step[i][j] = 0;**
** vis[i][j] = 1;**
** while (!qu.empty())**
** {**
** P z = qu.front();**
** for (int i = 0; i < 8; i++)**
** {**
** int dx = z.first + x[i];**
** int dy = z.second + y[i];**
** if (dx >= 1 && dx <= n && dy >= 1 && dy <= m && vis[dx][dy] == 0)**
** {**
** vis[dx][dy] = 1;**
** step[dx][dy] = step[z.first][z.second] + 1;**
** qu.push({dx, dy});**
** }**
** }**
** qu.pop();**
** }**
** for (int i = 1; i <= n; i++)**
** {**
** for (int j = 1; j <= m; j++)**
** {**
** if (vis[i][j] == 1)**
** {**
** cout << step[i][j] << ' ';**
** }**
** else**
** {**
** cout << -1 << ' ';**
** }**
** }**
** cout << '\n';**
** }**
** return 0;**
}