ABC452D No-Subsequence Substring

https://atcoder.jp/contests/abc452/tasks/abc452_d

首先转化为求包含 \(T\) 的子串数量。枚举左端点 \(l\),找到最小的 \(r\) 使得 \(S[l..r]\) 包含 \(T\),对答案的贡献为 \(n - r + 1\)。时间复杂度 \(O(|S||T|)\)

posted @ 2026-04-04 23:16  Sunsoak  阅读(14)  评论(0)    收藏  举报