func_code_string: #include <bits/stdc++.h>   using namespace std;   using namespace std;   const int maxn = 3e5 + 5;   int level[maxn * 2], num[maxn * 2], par[maxn * 2];   char s[maxn * 2];   stack<int> stk;   int main() {     int n, cnt = 0;     scanf( %d , &n);     scanf( %s , s + 1);     for (int i = 1; i <= n; i++) {       if (stk.empty())         stk.push(i);       else {         int c = stk.top();         if (s[i] ==  )  && s[c] ==  ( )           stk.pop();         else           stk.push(i);       }       s[i + n] = s[i];       cnt = cnt + ((s[i] ==  ( ) ? (1) : (-1));     }     if (cnt) return 0 & printf( 0 n1 1 n );     int j = 1;     while (!stk.empty()) {       int c = stk.top();       if (s[c] ==  ) ) break;       stk.pop();       j = c;     }     for (int i = 1; i <= n * 2; i++) level[i] = -1, num[i] = 0;     while (!stk.empty()) stk.pop();     for (int i = j; i <= j + n - 1; i++) {       if (stk.empty()) {         stk.push(i);         level[i] = 1;         cnt++;       } else {         int c = stk.top();         if (s[i] ==  )  && s[c] ==  ( ) {           stk.pop();           par[c] = i;         } else {           stk.push(i);           level[i] = stk.size();         }       }     }     int i = j;     while (i <= j + n - 1) {       if (level[i] == 1) {         int r = par[i], k = i;         while (i < r) {           if (level[i] == 2) num[k]++;           i++;         }       }       i++;     }     i = j;     while (i <= j + n - 1) {       if (level[i] == 2) {         int r = par[i], k = i;         while (i < r) {           if (level[i] == 3) num[k]++;           i++;         }       }       i++;     }     int ans = 0, l, r;     for (int i = j; i <= j + n - 1; i++) {       if (level[i] == 1) {         if (ans < (num[i] + 1)) {           ans = num[i] + 1;           l = i % n;           r = par[i] % n;         }       } else if (level[i] == 2) {         if (ans < (cnt + num[i] + 1)) {           ans = cnt + num[i] + 1;           l = i % n;           r = par[i] % n;         }       }     }     if (ans < cnt) ans = cnt, l = 1, r = 1;     if (l == 0) l = n;     if (r == 0) r = n;     printf( %d n%d %d n , ans, l, r);     return 0;   }   