在文件 acwing.cpp 第 2703 行定义.
2705 ops = vector<char>();
2706 forth = vector<pair<int, int>>();
2707 back = vector<pair<int, int>>();
2709 forth.emplace_back(0, 0);
2710 for(
int i = 0; i <
n; i++) {
2732 if(
forth.back().first ==
a &&
forth.back().second ==
b) {
2736 if(
n < abs(
a) + abs(
b) || (
n - (abs(
a) + abs(
b))) % 2 != 0) {
2741 for(
int i =
n - 1; i >= 0; i--) {
2744 back.emplace_back(
back.back().first,
back.back().second - 1);
2748 back.emplace_back(
back.back().first,
back.back().second + 1);
2752 back.emplace_back(
back.back().first + 1,
back.back().second);
2756 back.emplace_back(
back.back().first - 1,
back.back().second);
2765 const int mid = (l + r) / 2;
bool check(int len) const
引用了 a, b, back, check(), forth, n , 以及 ops.