在做P1967的时候,我在两个节点向上跳的时候,比较二者深度而非top节点深度而错误
wrong ans if(depth[left]<depth[right]) { swap(left, right); }
record 1
right ans if(depth[top[left]]<depth[top[right]]) { swap(left, right); }
record 2
奇怪的,为什么比较自身深度的时候就会WA,而比较top节点则会AC?感觉思路都是一样的