6892.Substring Distribution

Time Limit: 1s Memory Limit: 512MB

You are given a string of length $n$ . For every integer between $1 \ldots n$ you need to print the number of distinct substrings of that length.

Input Format(From the terminal/stdin)

The only input line has a string of length $n$ that consists of characters a–z.

  • $1 \le n \le 10^5$

Output Format(To the terminal/stdout)

For each integer between $1 \ldots n$ print the number of distinct substrings of that length.

Sample Input

Copy
abab
    \n

Sample Output

Copy
2 2 2 1
 · · · \n
Source: CSES, String Algorithms, 2110

Submit

请先 登录

© 2025 FAQs