#P6832. [Cnoi2020] 子弦
[Cnoi2020] 子弦
Problem Description
Cirno has a string , and wants you to find the maximum number of occurrences among all non-empty substrings of . Denote this number as .
Input Format
One line, a string .
Output Format
One line, an integer .
abababab
4
Hint
Constraints and Notes
For of the testdata, it is guaranteed that: , and .
Subtasks (this problem uses bundled tests)
- Subtask 1 (): .
- Subtask 2 (): .
- Subtask 3 (): no special constraints.
Glossary
- Substring: A subsequence consisting of any number of consecutive characters in a string is called a substring of that string.
Translated by ChatGPT 5