#C12780. Count Unique Substrings

    ID: 42245 Type: Default 1000ms 256MiB

Count Unique Substrings

Count Unique Substrings

Given a string ( s ), your task is to calculate the number of unique substrings present in it. A substring is defined as any contiguous sequence of characters within ( s ). For instance, if ( s = \texttt{abc} ), the unique substrings are: ( \texttt{a}, \texttt{b}, \texttt{c}, \texttt{ab}, \texttt{bc}, \texttt{abc} ), resulting in a count of 6. This problem tests your ability to perform string manipulation and utilize brute-force techniques efficiently.

inputFormat

Input is given via standard input. The input consists of a single line containing the string ( s ). The string may be empty.

outputFormat

Output the number of unique substrings of ( s ) to standard output.## sample

abc
6