#include <bits/stdc++.h>
using namespace std;
int main() {
// freopen("main.in", "r", stdin);
// freopen(".out", "w", stdout);
long long t; cin >> t;
while (t--){
long long n, k; cin >> n >> k;
long long p = 1;
while(p < k + 1) p <<= 1;
long long sm = 0;
for(long long i = 0; i < n; i++){
long long x; cin >> x;
sm ^= (x % p);
}
if(sm == 0) cout << '0' << endl;
else cout << '1' << endl;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |