func_code_string: #include <bits/stdc++.h>   using namespace std;   const int INF = 0x3f3f3f3f;   int deep[200000 + 10], to[200000 + 10];   int len;   string s;   stack<int> tmp;   int best_deep[200000 + 10];   void dfs(int l, int r, int dep) {     deep[l] = dep;     if (l == r - 1) {       best_deep[l] = dep;       return;     }     int now = l + 1;     int MAX_ = 0;     while (now < r - 1) {       dfs(now, to[now], dep + 1);       MAX_ = max(MAX_, best_deep[now]);       now = to[now] + 1;     }     best_deep[l] = MAX_;   }   int res[200000 + 10];   void recover(int l, int r, int dep) {     if (dep - 1 == best_deep[l] >> 1) {       for (int i = l; i <= r; ++i) {         res[i] = 1;       }       return;     }     if (l == r - 1) {       return;     }     int now = l + 1;     while (now < r - 1) {       recover(now, to[now], dep + 1);       now = to[now] + 1;     }   }   int main() {     scanf( %d , &len);     cin >> s;     for (int i = 0; i <= len - 1; ++i) {       if (s[i] ==  ( )         tmp.push(i);       else {         to[tmp.top()] = i;         tmp.pop();       }     }     int now = 0;     while (now < len - 1) {       dfs(now, to[now], 1);       now = to[now] + 1;     }     now = 0;     while (now < len - 1) {       for (int i = now; i <= to[now]; ++i) {         best_deep[i] = best_deep[now];       }       now = to[now] + 1;     }     now = 0;     while (now < len - 1) {       recover(now, to[now], 1);       now = to[now] + 1;     }     for (int i = 0; i <= len - 1; ++i) {       printf( %d , res[i]);     }     return 0;   }   