• [A] XorXor

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • Alex has a sequence S which contains n elements, let's define f(i, j) denoting the xor sum of Si, Si+1, ..., Sj. Now Alex wants to know the value of f(1, 1) xor f(1, 2) xor ... xor f(1, n) xor f(2, 2) xor f(2, 3) xor ... xor f(2, n) xor ... xor f(n, n).
  • 输入
  • Input starts with an integer T denoting the number of test case.
    For each test case, first line contains an integer n (1 <= n <= 100000).
    Next line contains n integers Si(1 <= Si <= 100000).
  • 输出
  • For each test case. print the value of
    f(1, 1) xor f(1, 2) xor ... xor f(1, n) xor f(2, 2) xor f(2, 3) xor ... xor f(2, n) xor ... xor f(n, n).
  • 样例输入
  • 1
    3
    1 3 2
  • 样例输出
  • 3
  • 提示
  • 来源
  • Alex@NBUT
  • 操作

显示春菜