CF888G Xor-MST
Description
You are given a complete undirected graph with $ n $ vertices. A number $ a_{i} $ is assigned to each vertex, and the weight of an edge between vertices $ i $ and $ j $ is equal to $ a_{i}xora_{j} $ .
Calculate the weight of the minimum spanning tree in this graph.
Input Format
The first line contains $ n $ ( $ 1\le n\le 200000 $ ) — the number of vertices in the graph.
The second line contains $ n $ integers $ a_{1} $ , $ a_{2} $ , ..., $ a_{n} $ ( $ 0\le a_{i}
Output Format
Print one number — the weight of the minimum spanning tree in the graph.