Comments

C is fraudulent, as I am amazed by the simple solution. (My friend typed a segment tree to solve it)

D is too easy, because the train of thought is obvious and normal.

Please don't judge the competition because of your lack of personal ability.

Some 'infants' are really outspoken.

Think of what should we do to make it more possible to be a RBS?

We know that if a sequence is a RBS, there is a equal expression: considering ( is +1 and ) is -1, and f_i means the sum of s_1 to s_i. For all the s_i = ), f_i is not less than 0. So we need to put more ( left and more ) right.

Think about not swapping the last ( and the first ), for example, we swap the first ( and the first ), what will happen? Compared with the original swapping, all the f_i between the first ( and the last ( minus 1, and the other f_i is not changed. So our now choice won't be better than the original one.

It should be pointed that there is no different intelligence factor between py coders and cpp coders.

But py runs a little slower than cpp somehow, and some of the submission on D was hacked(TLE) because of this reason.