条件相当于 $a_i,a_j$ 的二进制最高的位相同,所以只需要统计每种最高位的数的数量取最大值即可。
时间复杂度 $O(n+\log a)$。
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.
Type: Editorial
Status: Open
Posted by: jiangly
Posted at: 2025-12-14 06:56:12
Last updated: 2025-12-14 06:56:15
条件相当于 $a_i,a_j$ 的二进制最高的位相同,所以只需要统计每种最高位的数的数量取最大值即可。
时间复杂度 $O(n+\log a)$。