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;
int32_t main()
{
int t;
cin>>t;
while(t--)
{
int n, k;
cin>>n>>k;
int xsum=0;
int sus=0;
while(k > 1)
{
sus++;
k/=2;
}
k=(1<<sus);
for(int i=1; i<=n; i++)
{
int a;
cin>>a;
int c=a/k;
int r=a-c*k;
if(c%2 == 1)
{
c=k;
}
else
{
c=0;
}
xsum=(xsum^(c^r));
}
if(xsum == 0)
cout<<0;
else
cout<<1;
}
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... |