瞎搞
「POI2014」Salad Bar-瞎搞
· ✏️ 503 words · ☕ 2 mins read

有一个长度为 $n$ 的字符串,每一位只会是 $\text{p}$ 或 $\text{j}$ 。求一个最长子串,使得不管是从左往右还是从右往左取,都保证每时每刻已取出的 $\text{p}$ 的个数不小于 $\text{j}$ 的个数。