QOJ.ac

QOJ

时间限制: 2 s 内存限制: 256 MB 总分: 100

#99. 3-子串

统计

给定一个长度为 $N$ 的字符串 $S$。对于每个 $K = 1, 2, \dots, \lfloor \frac{N}{3} \rfloor$,你需要找出长度恰好为 $K$ 的不同子串的数量,使得每个子串在 $S$ 中至少出现三次且两两不重叠。

输入格式

输入仅包含一行,为一个字符串 $S$ ($3 \le |S| \le 100\,000$,$S$ 由小写英文字母组成)。

输出格式

输出 $\lfloor N/3 \rfloor$ 个数字,分别对应 $K = 1, K = 2, \dots, K = \lfloor N/3 \rfloor$ 的答案。

样例

输入格式 1

abracadabra

输出格式 1

1 0 0

输入格式 2

abacabaabacabaabacaba

输出格式 2

3 4 4 4 3 2 1

输入格式 3

aaaa

输出格式 3

1

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.