This problem is in Contest(s) below:
Contest 1139:2022年暑期普及班-字符
Contest 1040:csp/noip数据结构专练
Contest 1078:普及组水题专练