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>
#define int long long
using namespace std;
int n, k, t, sum = 0;
int v[100005];
void solve()
{
cin>>n>>k;
sum = 0;
for(int i = 1; i <= n; i++)
{
cin>>v[i];
sum += v[i];
}
while(k != 1 && sum % 2 != 1)
{
k /= 2;
sum = 0;
for(int i = 1; i <= n; i++)
{
if(v[i] != 0)
v[i] /= 2;
sum += v[i];
}
}
if(sum % 2 == 0)
cout<<0;
else
cout<<1;
return;
}
signed main()
{
cin>>t;
while(t--)
solve();
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... |