Substring

AtCoder
IDabc347_b
Time2000ms
Memory256MB
Difficulty
You are given a string $S$ consisting of lowercase English letters. How many different non-empty substrings does $S$ have? A substring is a contiguous subsequence. For example, `xxx` is a substring of `yxxxy` but not of `xxyxx`. ## Constraints * $S$ is a string of length between $1$ and $100$, inclusive, consisting of lowercase English letters. ## Input The input is given from Standard Input in the following format: $S$ [samples]
Samples
Input #1
yay
Output #1
5

$S$ has the following five different non-empty substrings:

*   `a`
*   `y`
*   `ay`
*   `ya`
*   `yay`
Input #2
aababc
Output #2
17
Input #3
abracadabra
Output #3
54
API Response (JSON)
{
  "problem": {
    "name": "Substring",
    "description": {
      "content": "You are given a string $S$ consisting of lowercase English letters. How many different non-empty substrings does $S$ have? A substring is a contiguous subsequence. For example, `xxx` is a substring of",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc347_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given a string $S$ consisting of lowercase English letters. How many different non-empty substrings does $S$ have?\nA substring is a contiguous subsequence. For example, `xxx` is a substring of...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments