Description
It is believed that everyone joined the match knows about the Minimum Spanning Tree.
A minimum spanning tree of an edge-weighted graph is a spanning tree whose weight (the sum of the weights of its edges) is no larger than the weight of any other spanning tree, and is also a connected acyclic subgraph of the graph.
In other words, keep
Now given a connected undirected edge-weighted graph, we define POWOR as the bitwise OR of edge weights of the spanning tree of this graph, and want to keep that POWOR as small as possible. You need to find the minimum POWOR .
Input
The first line is two integers
The next
Output
Output a single line with an integer representing the minimum POWOR.
Sample Input
3 3 1 2 1 1 3 2 2 3 4
Sample Output
3
Note
难度等级: | 0 |
总通过次数: | 20 |
总提交次数: | 154 |