This problem is in Contest(s) below:
Contest 1118:字符串入门
Contest 1030:枚举算法专题