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 <iostream>
#include <map>
#include <vector>
using namespace std;
int v[100005];
void testcase() {
int n, k;
cin >> n >> k;
for(int i = 1; i <= n; i ++) {
cin >> v[i];
}
bool ok = 0;
while(k >= 1) {
int sum = 0;
for(int i = 1; i <= n; i ++) {
sum += v[i];
}
if(sum %= 2) {
ok = 1;
}
k /= 2;
for(int i = 1; i <= n; i ++) {
v[i] /= 2;
}
}
cout << ok;
}
int main() {
int tests;
cin >> tests;
for(int i = 1; i <= tests; i ++) {
testcase();
}
return 0;
}
# | 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... |