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;
#define file \
freopen("in.txt" , "r" , stdin); \
freopen("out.txt" , "w" , stdout);
typedef long long ll;
void test_case () {
int n , k;
cin >> n >> k;
ll sum = 0;
int a[n];
for (int i = 0;i < n;i ++) {
cin >> a[i];
}
for (int x = 1;x <= k;x *= 2) {
sum = 0;
for (int i = 0;i < n;i ++) {
sum += (a[i] / x);
}
if (sum %2 != 0) {
cout << "1";
return;
}
}
cout << "0";
}
int32_t main () {
// file
int TIME = clock();
int t = 1;
cin >> t;
while (t --) {
test_case();
}
cerr << "\nTime elapsed: " << (clock() - TIME) * 1000.0 / CLOCKS_PER_SEC << " ms\n";
}
# | 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... |