#P10524. [XJTUPC 2024] 循环移位
[XJTUPC 2024] 循环移位
Problem Description
Given an array of length (), you may perform cyclic shifts any number of times.
Find the maximum values of , , and . Here, , , and denote bitwise XOR, bitwise AND, and bitwise OR, respectively.
For an array of length (), the result after one cyclic shift is :
$$x'_i = \left\{ \begin{array}{ll} x_{i - 1} & i \neq 0 \\ x_{m - 1} & i = 0 \end{array}\right.$$Input Format
The first line contains an integer (), as described above.
The next line contains integers (), representing the given array.
Output Format
Output one line with three integers separated by spaces, which are the maximum values of , , and .
2
1 3 2 2
8 5 11
4
1 1 4 5 1 4 1 9 1 9 8 1 0 0 0 0
149 41 157
Hint
Translated by ChatGPT 5