F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

so easy

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 1223    Accepted Submission(s): 749


Problem Description
Given an array with $$n$$ integers, assume $f(S)$ as the result of executing xor operation among all the elements of set $S$. e.g. if $S = \{1,2,3\}$ then $f(S) = 0$.

your task is: calculate xor of all $f(s)$, here $s \subseteq S$.
 

Input
This problem has multi test cases. First line contains a single integer $T(T\leq 20)$ which represents the number of test cases.
For each test case, the first line contains a single integer number $n(1\leq n \leq 1,000)$ that represents the size of the given set. then the following line consists of $n$ different integer numbers indicate elements($\leq 10^9$) of the given set.
 

Output
For each test case, print a single integer as the answer.
 

Sample Input
1 3 1 2 3
 

Sample Output
0 In the sampleŁ¬$S = \{1, 2, 3\}$, subsets of $S$ are: $\varnothing$, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-25 10:19:42, Gzip enabled