This problem is in Contest(s) below:
Contest 1144:后缀数组入门
Contest 1242:后缀数组&&AC自动机
Contest 1356:后缀数组入门