cf1182d专题

【树哈希】CF1182D Complete Mirror

CF1182D - Complete Mirror Description 给定一个 n n n 个点的无根树,求一个树根 r o o t root root,使得对于任意两个节点 v 1 , v 2 v_1,v_2 v1​,v2​,若满足 d i s t ( v 1 , r o o t ) = d i s t ( v 2 , r o o t ) dist(v_1,root)=dist(