QOJ.ac

QOJ

Type: Editorial

Status: Open

Posted by: jiangly

Posted at: 2025-12-14 06:56:12

Last updated: 2025-12-14 06:56:15

Back to Problem

题解

条件相当于 $a_i,a_j$ 的二进制最高的位相同,所以只需要统计每种最高位的数的数量取最大值即可。

时间复杂度 $O(n+\log a)$。

Comments

No comments yet.