Good

CF316G3 - Good Substrings

有点厉害。 首先给一个 $\text{SAM}$ 的做法。我们先对所有串建立 $\text{SAM}$,然后对于每个 $T$,我们先预处理对于每个节点对应的 $endpos$ 集合,多长的子串可以满足条件。 然后,我们把 $S$ 串往当前的自动机输入,每次会来到一个 $endpos$ 集合。同时再输 ......
Substrings 316G Good 316 CF

ARC159F Good Division【性质,DP,线段树】

定义一个序列是好的当且仅当其可以通过每次删去一对相邻的不同的数把序列删空。 给定一个长度为 $2n$ 的序列 $a$,求有多少种划分方式使得每一段都是好的。答案对 $998244353$ 取模。 $n \leq 5 \times 10^5$,时限 $\text{5.0s}$。 先考虑什么样的数列是合 ......
线段 Division 性质 159F Good

Good Segment

Given an array of bad numbers and a range of integers, determine the longest segment of integers within the range that does not include any bad number ......
Segment Good