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 <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <utility>
#include <queue>
#include <map>
#include <iomanip>
#include <stack>
#include <fstream>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
int n,k,t;
long long int s;
cin>>t;
while(t--){
cin>>n>>k;
vector<long long int>c(n);
int x=0;
for(int i=0;i<n;i++){
cin>>c[i];
if(c[i]%2==1){
x++;
}
}
if(x%2==1){
cout<<1;
}
else {
s=0;
while(k!=1 && s%2==0){
for(int i=0;i<n;i++){
c[i]/=2;
s+=c[i];
}
k/=2;
}
if(s%2==1)cout<<1;
else cout<<0;
}
}
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... |