题目链接:
so easyTime Limit: 2000/1000 MS (Java/Others)
Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 138 Accepted Submission(s): 110
your task is: calculate xor of all f(s), here s⊆S.
For each test case, the first line contains a single integer number n(1≤n≤1,000) that represents the size of the given set. then the following line consists of ndifferent integer numbers indicate elements(≤109) of the given set.
#include <iostream> #include <cstring> #include <cstdio> #include <algorithm> using namespace std; const long long mod=1e9+7; int main() { int t,n,a[1004]; scanf("%d",&t); while(t--) { scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d",&a[i]); } if(n==1) { cout<<a[1]<<"\n"; } else cout<<"0"<<"\n"; } return 0; }