正文
增加 3 行删除 3 行
13 行未改动1415161718192021223 行未改动2627282930313233343536373839404142434416 行未改动13 行未改动#include <bits/stdc++.h>using namespace std;constexpr int N(3e5 + 2);char s[N], a, b;int k, n, m, R, C, ap[N], bp[N];inline int typ(char op) { // 判断操作是上下还是左右return op == '<' || op == '>';}bool check_a(int limit) {3 行未改动if (pos < 0) pos = 0;else if (pos >= limit) pos = limit - 1;}return pos >= C;}bool check_b(int limit) {int pos(0);for (int i(1); i <= m; ++i) {pos += bp[i];if (pos < 0) pos = 0;else if (pos >= limit) pos = limit - 1;}return pos >= R;}int main() { // 二分ios::sync_with_stdio(false);cin.tie(nullptr), cout.tie(nullptr);cin >> k >> s >> R >> C;for (int i(0); i < k; ++i) // 行与列分开处理16 行未改动13 行未改动1415161718192021223 行未改动2627282930313233343536373839404142434416 行未改动13 行未改动#include <bits/stdc++.h>using namespace std;constexpr int N(3e5 + 2);char s[N], a, b;int k, n, m, R, C, ap[N], bp[N];inline int typ(char op) { // 判断操作是上下还是左右return op == '<' || op == '>';}bool check_a(int limit) {3 行未改动if (pos < 0) pos = 0;else if (pos >= limit) pos = limit - 1;}return pos >= C;}bool check_b(int limit) {int pos(0);for (int i(1); i <= m; ++i) {pos += bp[i];if (pos < 0) pos = 0;else if (pos >= limit) pos = limit - 1;}return pos >= R;}int main() { // 二分ios::sync_with_stdio(false);cin.tie(nullptr), cout.tie(nullptr);cin >> k >> s >> R >> C;for (int i(0); i < k; ++i) // 行与列分开处理16 行未改动