412 传统题

[CF1669H] 最大按位与 (Maximal AND)

时间限制
2000ms
内存限制
256MiB
登顶 / 尝试
1/ 1
难度
3
    上传者 标签CodeforcesCF1669普及位运算贪心

[CF1669H] 最大按位与 (Maximal AND)

Given array a of length n (0 <= a_i < 2^31) and k (0 <= k <= 10^9). In one operation pick i and set j-th bit (0 <= j <= 30) of a_i to 1. Maximize a_1 & a_2 & ... & a_n using at most k operations. Constraints: 1 <= t <= 100, 1 <= n <= 210^5, sum(n) <= 210^5.