This problem is in Contest(s) below:
Contest 1502:Trie及Ac自动机入门
Contest 1499:YC_2021_3月