显然固定 $l$ 之后,$r$ 越大越好。于是我们只需要对 $T$ 建出后缀自动机,然后用 $S$ 在后缀自动机上跑即可。
时间复杂度 $O(|S|+|T||\Sigma|)$。
As we are currently experiencing an overwhelming number of web requests for fetching user submissions, we have temporarily disabled the full submissions list. You must now be logged in to view submissions.
Type: Editorial
Status: Open
Posted by: jiangly
Posted at: 2025-12-12 23:32:29
Last updated: 2025-12-12 23:32:33
显然固定 $l$ 之后,$r$ 越大越好。于是我们只需要对 $T$ 建出后缀自动机,然后用 $S$ 在后缀自动机上跑即可。
时间复杂度 $O(|S|+|T||\Sigma|)$。