This problem is in Contest(s) below:
Contest 1120:Dfs进阶
Contest 1268:Dfs复习
Contest 1355:最靓的仔
Contest 1421:dfs
Contest 1527:dfs深度优先搜索
Contest 1428:YC-递归深搜复习