#include <bits/stdc++.h>
#define int long long
using namespace std;
int32_t main()
{
int t;
cin>>t;
while(t--)
{
int n, k;
cin>>n>>k;
int xsum=0;
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=(1LL*xsum^(1LL*(c^r)));
}
if(xsum == 0)
cout<<0;
else
cout<<1;
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
29 ms |
348 KB |
Output is correct |
2 |
Correct |
36 ms |
344 KB |
Output is correct |
3 |
Correct |
30 ms |
348 KB |
Output is correct |
4 |
Correct |
30 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
28 ms |
600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
133 ms |
592 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
172 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
32 ms |
348 KB |
Output is correct |
2 |
Correct |
30 ms |
348 KB |
Output is correct |
3 |
Correct |
36 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
30 ms |
348 KB |
Output is correct |
2 |
Correct |
30 ms |
348 KB |
Output is correct |
3 |
Correct |
30 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
30 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |