文字列アルゴリズム詰め合わせです。 文字列に関する様々なアルゴリズムが入っています。
// (1)
public static int[] suffixArray(java.lang.String s)
// (2)
public static int[] suffixArray(char[] s)
// (3)
public static int[] suffixArray(int[] s)
// (4)
public static int[] suffixArray(int[] s, int upper)
長さ の文字列 s の Suffix Array として、長さ の int 配列を返します。
Suffix Array saは の順列であって、各 について を満たすものです。
制約
計算量
// (1)
public static int[] lcpArray(java.lang.String s, int[] sa)
// (2)
public static int[] lcpArray(char[] s, int[] sa)
// (3)
public static int[] lcpArray(int[] s, int[] sa)
長さ の文字列 s の LCP Array として、長さ の配列を返します。
番目の要素は の LCP ( Longest Common Prefix ) の長さです。
制約
sa は s の Suffix Array計算量
[ https://atcoder.jp/contests/practice2/submissions/16585271 ]
// (1)
public static int[] zAlgorithm(java.lang.String s)
// (2)
public static int[] zAlgorithm(char[] s)
// (3)
public static int[] zAlgorithm(int[] s)
入力の長さを として、長さ の配列を返します。
番目の要素は と の LCP ( Longest Common Prefix ) の長さです。
制約
計算量