点分治,然后按照点分树上的深度从深到浅删除。容易发现每次删除之后,不会在同一深度的点之间连边,所以是合法方案。删除的次数也就是点分树的高度,即 $\lceil \log (n+1)\rceil$。
QOJ.ac
QOJ
As we are currently experiencing an overwhelming number of web requests for fetching user submissions, we have temporarily disabled the full submissions list. You must now be logged in to view submissions.
Discussion #160 for Problem #6745. Delete the Tree
Type: Editorial
Status: Open
Posted by: jiangly
Posted at: 2025-12-12 23:43:11
Last updated: 2025-12-12 23:43:17
题解
Comments
No comments yet.