后缀自动机 study from : http://hihocoder.com/contest/hiho127/problem/1 http://hihocoder.com/contest/hiho128/problem/1