Type: Default 1000ms 256MiB

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Background

云层中水汽遇冷变成的降向地面的水滴,叫作

Description

给定 nn 个数 aia_i,你可以对它们进行如下至多 kk 次操作:

  • 选定一个 aia_i 和一个整数 ll,要求 l[0,30]Nl \in [0, 30] \cap \mathbb{N},将 aia_i二进制意义下的第 ll 位设为 00

求操作后 a1anda2anda3andandana_1 \operatorname{and}a_2 \operatorname{and}a_3 \operatorname{and} \cdots \operatorname{and}a_n最小值。其中 and\operatorname{and} 表示按位与运算,在 C++ 中 aandba \operatorname{and} b 可以写成 a & b

Input

共读入 22 行:

  • 11 行:22 个整数 n,kn, k,表示数字个数和最多的操作次数;
  • 22 行:nn 个整数表示 aia_i

outpUt

  • 输出仅 1111 个整数,表示答案。

Samples

3 2
39
54
46
2
  • (39)10=(100111)2(39)_{10} = (100111)_2
  • (54)10=(110110)2(54)_{10} = (110110)_2
  • (46)10=(101110)2(46)_{10} = (101110)_2

Limitation

Subtask\text{Subtask} aia_i \le 特殊性质 得分
11 11 2020
22 23112^{31} - 1 所有 aia_i 都相同 4040
33 23112^{31} - 1 保证数据随机 1010
44 23112^{31} - 1 130130
  • 对于 100%100\% 的数据,1n1051 \le n \le 10^50ai,k<2310 \le a_i, k < 2^{31}

可以证明答案一定在 C/C++/Java 的 int 和 Pascal 的 longint 范围内。

在 C++ 中,(x >> k - 1) & 1 意为取 xx 二进制下的第 kk 位。zx\color{white}zx.

[北辰杯 North-Star-Cup] 九月入门赛

Not Attended
Status
Done
Rule
Ledo
Problem
6
Start at
2023-9-22 18:00
End at
2023-9-23 0:00
Duration
6 hour(s)
Host
Partic.
80