#abc347b. B - Substring
B - Substring
Score: points
问题陈述
给定一个由小写英文字母组成的字符串 。 有多少个不同的非空子串?
子串是连续的子序列。例如,xxx
是 yxxxy
的子串,但不是 xxyxx
的子串。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
You are given a string consisting of lowercase English letters. How many different non-empty substrings does have?
A substring is a contiguous subsequence. For example, xxx
is a substring of yxxxy
but not of xxyxx
.
Constraints
- is a string of length between and , inclusive, consisting of lowercase English letters.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
yay
Sample Output 1
5
has the following five different non-empty substrings:
a
y
ay
ya
yay
Sample Input 2
aababc
Sample Output 2
17
Sample Input 3
abracadabra
Sample Output 3
54