Suffix tree#4162

Suffix tree

2 sekunt
256 megabaýt
Ýeňil

Construct a suffix tree for the given string .

Giriş

The first line of the input contains the string (1 \leq |s| \leq 100000). The string is composed of lowercase Latin letters.

Çykyş

On the first line of the output, print two natural numbers and , separated by a space, representing the number of vertices and edges in the suffix tree, respectively. In the following lines, provide the descriptions of the edges in the format: <ancestor> <descendant> <> <>. This indicates that the edge is labeled with the substring , where is the smallest possible value. The root of the tree should be the vertex numbered . Vertices should be numbered using natural numbers not exceeding .

Mysallar

1-nji mysal

Loading
Loading