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>
using namespace std;
using ll = long long;
const int N = 100100;
int n, k;
int a[N];
void solve() {
cin >> n >> k;
for (int i = 1; i <= n; ++i) {
cin >> a[i];
}
bool ans = 0;
for (int j = 0; (1 << j) <= k; ++j) {
ll sum = 0;
for (int i = 1; i <= n; ++i) {
sum += (a[i] / (1 << j));
}
if (sum & 1) {
ans = 1;
break;
}
}
cout<<ans;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
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... |