[CF 1156F]Card Bag
You have a bag which contains n cards. There is a number written on each card; the number on i-th card is ai.
You have a bag which contains n cards. There is a number written on each card; the number on i-th card is ai.
You are given a tree
把先前信息低的两篇blog给拆了,这样好点.
Today, as a friendship gift, Bakry gave Badawy n integers a1,a2,…,an and challenged him to choose an integer X such that the value max1≤i≤n(ai⊕X) is minimum possible, where ⊕ denotes the bitwise XOR operation.
As always, Badawy is too lazy, so you decided to help him and find the minimum possible value of max1≤i≤n(ai⊕X).