#P10420. [蓝桥杯 2023 国 A] 子串
[蓝桥杯 2023 国 A] 子串
Problem Description
Given a string consisting only of lowercase English letters, ask how many distinct strings appear in exactly times. If two strings differ in length or in the character at any position, we consider them different.
Input Format
Input one line containing a string , consisting of lowercase English letters.
Output Format
Output lines, each containing an integer. The integer on line denotes the number of strings that appear exactly times in .
abb
4
1
0
Hint
[Sample Explanation 1]
a, ab, bb, abb appear once, and b appears twice.
[Test Case Size and Conventions]
For of the test cases, .
For of the test cases, .
For all test cases, .
Translated by ChatGPT 5