【模板】扩展 KMP/exKMP(Z 函数)
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
题目描述
给定两个字符串 ,你要求出两个数组:
- 的 函数数组 ,即 与 的每一个后缀的 LCP 长度。
- 与 的每一个后缀的 LCP 长度数组 。
对于一个长度为 的数组 ,设其权值为 。
输入格式
两行两个字符串 。
输出格式
第一行一个整数,表示 的权值。
第二行一个整数,表示 的权值。
aaaabaa
aaaaa
6
21
提示
样例解释:
,。
数据范围:
对于第一个测试点,。
对于第二个测试点,。
对于 的数据,,所有字符均为小写字母。
ch16 - Manacher 与 Z 函数
- Status
- Done
- Problem
- 8
- Open Since
- 2024-1-27 12:00
- Deadline
- 2024-3-3 23:59
- Extension
- 2400 hour(s)