CF1264D2 Beautiful Bracket Sequence (hard version)
CodeforcesLuogu分析考虑枚举一个分界点,如果左边的 ( 和右边的 ) 相等,那么深度就是左边的 ( 数。设 $l$ 为左边的 ( 数、$f$ 为左边的 ? 数、$r$ 为右边的 ) 数、$g$ 为右边的 ? 数,枚举深度,方案数为时间复杂度 $\mathcal{O}(n)$。代码// ==================================== // autho...
如果有写的不好的文章欢迎评论,我会在有时间的时候重写一篇更好的。