{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n #problem-body \u003e pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv id\u003d\"problem-body\"\u003e\n\t\u003cp\u003eGiven a string, we need to find the total number of its distinct substrings.\u003c/p\u003e\r\n\u003ch3\u003eInput\u003c/h3\u003e\r\n\u003cp\u003eT- number of test cases. T\u0026lt;\u003d20;\u003cbr\u003e\r\nEach test case consists of one string, whose length is \u0026lt;\u003d 1000\u003c/p\u003e\r\n\u003ch3\u003eOutput\u003c/h3\u003e\r\n\u003cp\u003eFor each test case output one number saying the number of distinct substrings.\u003c/p\u003e\r\n\r\n\u003ch3\u003eExample\u003c/h3\u003e\r\n\u003ctt\u003e\r\n\u003cp\u003e\u003cstrong\u003eSample Input:\u003c/strong\u003e\u003cbr\u003e\r\n 2\u003cbr\u003e\r\n CCCCC\u003cbr\u003e\r\n ABABA\u003c/p\u003e\r\n\u003cp\u003e\u003cstrong\u003eSample Output:\u003c/strong\u003e\u003cbr\u003e\r\n 5\u003cbr\u003e\r\n 9\u003c/p\u003e\r\n\u003c/tt\u003e\r\n\r\n\u003cp\u003eExplanation for the testcase with string ABABA: \u003cbr\u003e\r\n len\u003d1 : A,B\u003cbr\u003e\r\n len\u003d2 : AB,BA\u003cbr\u003e\r\n len\u003d3 : ABA,BAB\u003cbr\u003e\r\n len\u003d4 : ABAB,BABA\u003cbr\u003e\r\n len\u003d5 : ABABA\u003cbr\u003e\r\n\r\n Thus, total number of distinct substrings is 9.\u003cbr\u003e\r\n\u003c/p\u003e\n\u003c/div\u003e"}}]}