C. [Atc347B] Substring

    传统题 1000ms 256MiB

[Atc347B] Substring

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

Problem Statement

You are given a string SS consisting of lowercase English letters. How many different non-empty substrings does SS have?

A substring is a contiguous subsequence. For example, xxx is a substring of yxxxy but not of xxyxx.

Constraints

  • SS is a string of length between 11 and 100100, inclusive, consisting of lowercase English letters.

Input

The input is given from Standard Input in the following format:

S

Output

Print the number of different non-empty substrings of SS.

Examples

Example 1

yay
5

S has the following five different non-empty substrings:

  • a
  • y
  • ay
  • ya
  • yay

Example 2

aababc
17

Example 3

abracadabra
54

Programming exercise on 13 August

未参加
状态
已结束
规则
IOI
题目
3
开始于
2024-8-13 16:30
结束于
2024-8-13 18:30
持续时间
2 小时
主持人
参赛人数
3