# CF1167D Bicolored RBS
Short code greedy
Topic Link (Los Valley)
greedy title.
Meet opening parenthesis minutes into the shallow depth of colors
to meet closing parenthesis divided into deeper color depth
Code really short
code show as below:
#include<bits/stdc++.h>
using namespace std;
const int maxn=2*1e5+10;
int n,rs=0,bs=0;char a[maxn];
int main(){
scanf("%d%s",&n,a);
for(int i=0;i<n;i++){
if(a[i]==')') (rs>bs) ? (--rs,printf("0")) : (--bs,printf("1"));
else if(a[i]=='(') (rs<bs) ? (++rs,printf("0")) : (++bs,printf("1"));
}
return 0;
}