func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 1000050;   const int inf = 0x3f3f3f3f;   const int mod = 1e9 + 7;   int a[maxn], b[maxn], mi, ans1, ans2, ans3, ans, l, r;   vector<int> v;   char s[maxn];   void pa(int s, int e) {     ans2 = 0;     for (int i = s; i < e; i++)       if (a[i] == mi + 1) ans2++;     if (ans2 > ans) {       ans = ans2;       l = s, r = e;     }     ans3 = 0;     int x = s + 1;     for (int i = s + 1; i < e; i++) {       if (a[i] == mi + 1) {         if (ans3 + ans1 > ans) {           ans = ans1 + ans3;           l = x, r = i;         }         x = i + 1;         ans3 = 0;       }       if (a[i] == mi + 2) ans3++;     }   }   int main() {     int n, m, i, j, k, t;     scanf( %d , &n);     scanf( %s , s + 1);     for (i = 1; i <= n; i++)       a[i] = s[i] ==  (  ? a[i - 1] + 1 : a[i - 1] - 1, mi = min(mi, a[i]);     if (a[n] != 0) printf( 0 n1 1 n ), exit(0);     for (i = n + 1; i <= 2 * n; i++) a[i] = a[i - n];     for (i = 1; i <= n; i++)       if (a[i] == mi) v.push_back(i);     ans = ans1 = v.size();     l = r = 1;     v.push_back(v[0] + n);     for (i = 0; i < v.size() - 1; i++) pa(v[i] + 1, v[i + 1]);     printf( %d n%d %d n , ans, l > n ? l - n : l, r > n ? r - n : r);     return 0;   }   