BFS,用并查集维护可以传送到的点,来保证每个点只会被枚举到一次。或是除距离外,再记一下当前最多还可以传送几次,这也可以用 BFS 来更新。时间复杂度 $O(n^2)$。
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 #157 for Problem #6739. Teleport
Type: Editorial
Status: Open
Posted by: jiangly
Posted at: 2025-12-12 23:39:03
Last updated: 2025-12-12 23:39:07
题解
Comments
No comments yet.