This problem is in Contest(s) below:
Contest 1452:【算法8】树基础专题
Contest 1475:【算法7】栈与队列
Contest 1531:高级班寒假作业