func_code_string: #include <bits/stdc++.h>   using namespace std;   const double pi = acos(-1.0);   const double eps = 1e-10;   const int MOD = 998244353;   const int INF = 0x3f3f3f3f;   const int maxn = 1e3 + 10;   const int maxm = 2e5 + 10;   char s[maxn];   int len, arr[maxn];   pair<int, long long> dq[maxn];   int main() {     scanf( %d%s , &len, s + 1);     for (int i = 1; i <= len; ++i) s[len + i] = s[i];     int ans = 0;     pair<int, long long> pos;     for (int i = 1; i <= len; ++i)       for (int j = i; j <= len; ++j) {         int cnt = 0;         swap(s[i], s[j]);         swap(s[i + len], s[j + len]);         int top = 500, bk = 499;         for (int k = 1; k <= len * 2; ++k) {           if (s[k] ==  ( )             arr[k] = ++cnt;           else             arr[k] = --cnt;         }         for (int k = 1; k <= len; ++k) {           while (bk >= top && dq[bk].first > arr[k]) --bk;           dq[++bk] = {arr[k], k};         }         int pre = 0, res = 0;         for (int k = 1; k <= len; ++k) {           while (dq[top].second < k) ++top;           while (bk >= top && dq[bk].first >= arr[k + len - 1]) --bk;           dq[++bk] = {arr[k + len - 1], k + len - 1};           if (dq[top].first - pre >= 0 && arr[k + len - 1] - pre == 0) ++res;           pre = arr[k];         }         if (ans < res) {           ans = res;           pos = {i, j};         }         swap(s[i], s[j]);         swap(s[i + len], s[j + len]);       }     printf( %d n , ans);     if (pos.first == 0) pos = {1, 1};     printf( %d %d n , pos.first, pos.second);     return 0;   }   