#D. 数字操作

    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.

给你一个长度为 nn 的非负整数数组 a1,a2,,ana_1, a_2, \dots , a_n

你可以选择一个非负整数 xx

bi=aib_i = a_i xor x x。 xor 为异或运算,把两个操作数按二进制位运算,如果两个数二进制下第kk位相同,则运算结果的二进制下第kk位为0,否则为1。

m=max(b1,b2,,bn)m=max(b_1, b_2, \dots , b_n)

mm 的最小值是多少。

输入格式

第一行一个整数 nn

第二行 nn 个非负整数 a1,a2,,ana_1, a_2, \dots , a_n

输出格式

一行一个整数。

输入1

3
1 2 3

输出1

2

解释1

选择 x=3x=3b1=2,b2=1,b3=0b_1=2, b_2=1, b_3=0m=2m=2

数据范围

1n150000;0ai<2301 \le n \le 150000; 0 \le a_i \lt 2^{30}

中大计算机 1

Not Attended
Status
Done
Rule
IOI
Problem
6
Start at
2025-6-23 10:30
End at
2025-6-23 12:30
Duration
2 hour(s)
Host
Partic.
1