涉及二进制的异或运算 ^
n = int(input())
s = list(map(int,input().split()))
apples = 0
ans = 0
for i in range(n):
apples = apples ^ s[i]
if apples == 0:
s = sorted(s)
ans = sum(s) - s[0]
print(ans)
else:
print(-1)
涉及二进制的异或运算 ^
n = int(input())
s = list(map(int,input().split()))
apples = 0
ans = 0
for i in range(n):
apples = apples ^ s[i]
if apples == 0:
s = sorted(s)
ans = sum(s) - s[0]
print(ans)
else:
print(-1)