Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include<bits/stdc++.h>#define FILEIN freopen("in.txt", "r", stdin)#define FILEOUT freopen("out.txt", "w", stdout)#define CLOSEIO ios::sync_with_stdio(false)#define PI acos(-1)#define mod 1000000007#define eps 1e-11#define PB(x) push_back(x)#define MP(x, y) make_pair(x, y)using namespace std;const int maxn = 19+10;typedef long long LL;const LL inf = (1LL<<30-1);bool vis[3][maxn][maxn];int dp[3][maxn][maxn];int dir[8][2] = {-2, 1, -1, 2, 1, 2, 2, 1, 2, -1, 1, -2, -1, -2, -2, -1};void init(){memset(vis, false, sizeof(vis));memset(dp, 0, sizeof(vis));}void bfs(int x0, int y0, int s){queue<int> qx, qy;vis[s][x0][y0] = true;dp[s][x0][y0] = 0;qx.push(x0);qy.push(y0);while(!qx.empty()){