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>
using namespace std;
int v[100005];
int main()
{
int n,t,k,sum=0;
cin>>t;
for(int i=0;i<t;i++)
{
sum=0;
cin>>n>>k;
for(int i=0;i<n;i++)
cin>>v[i],sum+=v[i],sum%=2;
if(sum==1)
cout<<1;
else
{
int ok=0;
while(k>1)
{
k/=2;
sum=0;
for(int i=0;i<n;i++)
v[i]/=2,sum+=v[i],sum%=2;
if(sum==1)
{
cout<<1;
ok=1;
break;
}
}
if(ok==0)
cout<<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... |