#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>>1);
}
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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
33 ms |
348 KB |
Output is correct |
2 |
Correct |
29 ms |
344 KB |
Output is correct |
3 |
Correct |
29 ms |
348 KB |
Output is correct |
4 |
Correct |
31 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2033 ms |
344 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2012 ms |
344 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2055 ms |
348 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2099 ms |
344 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2009 ms |
344 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2023 ms |
344 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2027 ms |
344 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |