| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 2048 MB | 75 | 34 | 33 | 50.000% |
Lulu has a string consisting of lowercase English letters. She would like to make her string Repetitive. A repetitive string has an even number of characters, and the first half of the string exactly matches the second half of the string. For example, "lulu", "abcabc" and "xx" are repetitive strings, while "xyx" and "abac" are not.
To get a repetitive string, Lulu can take two non-overlapping, non-empty substrings from her string and concatenate them together. The substrings must be concatenated in the order that they appear in her string.
She's wondering, what is the number of ways she can choose two substrings to make a repetitive string? Two ways are different if at least one of the substrings Lulu uses comes from a different part of her string.
Consider the string "aaaa".
So there are nine ways for Lulu to form a repetitive string by concatenating non-overlapping, non-empty substrings of "aaaa" in order.
The single line of input contains a single string $s$ (1ドル \le |s| \le 800, s \in \{a-z\}^*$). This is Lulu's string.
Output a single integer, which is the number of ways Lulu can concatenate two non-overlapping, non-empty substrings from her string in order to get a repetitive string.
aaaa
9
axabxbcxcdxd
22
ICPC > Regionals > North America > North America Championship > North America Championship 2023 J번