#include <cmath> #include <iostream> #include <vector> using namespace std; const int N = 20; int n, m, p; int board[N][N]; bool st[N][N]; int x[4] = {0, 0, 1, -1}; int y[4] = {1, -1, 0, 0}; int r[4] = {1, 1, 0, 3}; // 坐标系的建立方向有讲究 typedef pair<int, int> PII; struct mypoi...