No tags yet

No tag edit access

The problem statement has recently been changed. View the changes.

×
time limit per test: 0.25 sec.

memory limit per test: 65536 KB

memory limit per test: 65536 KB

input: standard

output: standard

output: standard

The sequence of non-negative integers A1, A2, ..., AN is given. You are to find some subsequence Ai_{1}, Ai_{2}, ..., Ai_{k} (1 <= i_{1} < i_{2} < ... < i_{k} <= N) such, that Ai_{1} XOR Ai_{2} XOR ... XOR Ai_{k} has a maximum value.

The first line of the input file contains the integer number N (1 <= N <= 100). The second line contains the sequence A1, A2, ..., AN (0 <= Ai <= 10^18).

Write to the output file a single integer number -- the maximum possible value of Ai_{1} XOR Ai_{2} XOR ... XOR Ai_{k}.

Input

3

11 9 5

11 9 5

Output

14

Author: | Michael R. Mirzayanov |

Resource: | ACM ICPC 2004-2005, NEERC, Southern Subregional Contest |

Date: | Saratov, October 7, 2004 |

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jun/14/2021 22:34:44 (g1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|