QOJ.ac

QOJ

Type: Editorial

Status: Open

Posted by: jiangly

Posted at: 2025-12-12 23:32:29

Last updated: 2025-12-12 23:32:33

Back to Problem

题解

显然固定 $l$ 之后,$r$ 越大越好。于是我们只需要对 $T$ 建出后缀自动机,然后用 $S$ 在后缀自动机上跑即可。

时间复杂度 $O(|S|+|T||\Sigma|)$。

Comments

No comments yet.