This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define fi first
#define se second
#define int long long
using namespace std;
int a[100001];
void solve(){
int n, k; cin >> n >> k;
for(int i = 0; i < n; i++) cin >> a[i];
sort(a, a + n);
for(int j = 1; j <= k; j *= 2){
int tot = 0;
for(int i = 0; i < n; i++){
tot += a[i] / j % 2;
}
if(tot % 2 == 1){
cout << 1;
return;
}
}
cout << 0;
}
int32_t main(){
cin.tie(0); cout.tie(0)->sync_with_stdio(false);
int t; cin >> t;
while(t--) solve();
}
# | 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... |