CF1536C Diluc and Kaeya
题目描述
给你一个字符串 $S$,其中只包含 'K' 或 'D' 两种字符,要求划分这个字符串使得各部分的 $n(D):n(K)$ 相同,其中 $n(D)$ 表示 $S$ 中字符 'D' 出现的个数,最大化划分后形成的组数。
求出 $S$ 的所有前缀中的上述答案。
输入格式
无
输出格式
无
说明/提示
For the first test case, there is no way to partition 'D' or 'DDK' into more than one block with equal ratios of numbers of 'D' and 'K', while you can split 'DD' into 'D' and 'D'.
For the second test case, you can split each prefix of length $ i $ into $ i $ blocks 'D'.