This problem is in Contest(s) below:
Contest 1982:提高组期末考试
Contest 1593:dfs练习
Contest 2105:26夏令营算法提高D——结营测试
Contest 1301:国庆集训第四天
Contest 1269:数据结构基础班测试——收官之战.