This problem is in Contest(s) below:
Contest 4292:北海专二班 字符串课堂练习
Contest 4300:北海专一班 字符串作业