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;
ifstream fin("rollercoaster.in");
ofstream fout("rollercoaster.out");
long long sum;
int t,n,k,i,a[100005];
signed main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cin>>t;
while(t--)
{
cin>>n>>k;
for(i=1;i<=n;i++)
cin>>a[i];
bool ok=0;
while(k>0)
{
sum=0;
for(i=1;i<=n;i++)
{
sum+=a[i];
a[i]/=2;
}
if(sum%2==1)
{
cout<<1;
ok=1;
break;
}
k/=2;
}
if(!ok)cout<<0;
//cout<<'\n';
}
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... |