Codeforces Round #723 Oolimry and Suffix Array Solution (Java/C++)
Solution: Let us represent the string to c. First, we can notice that: for i<j, there must be $c_{s[i]}\leq c_{s[j]}$. For example, $[3,2,4,1,0,5,6]$, at least we have $c_3\leq c_2\leq c_4\leq c_1\leq c_0\leq c_5\leq c_6$.…