This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#pragma GCC optimize("O3,unroll-loops")
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define INF 1000000007
int n,k;
int a[100001];
bool verif1()
{
int sum=0;
for(int i=1;i<=n;i++)
sum+=a[i];
if(sum%2==1)
return 1;
return 0;
}
bool isput2(int x)
{
int put=1;
while(put<x)
put=put*2;
if(put==x)
return 1;
return 0;
}
signed main()
{
ios_base::sync_with_stdio(0);cin.tie(0);
int t;
cin>>t;
while(t--)
{
cin>>n>>k;
int mxm=0;
for(int i=1;i<=n;i++)
cin>>a[i],mxm=max(mxm,a[i]);
k = min(k,mxm);
bool bl=0;
while(k>0)
{
int aux=0;
for(int i=1;i<=n;i++)
{
aux+=a[i];
a[i]/=2;
}
if(aux%2==1)
{
bl=1;
break;
}
k/=2;
}
if(bl)
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... |