#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
int t;
int arr[100005];
signed main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cin >> t;
for(int e=1;e<=t;e++){
int n,k;
cin >> n >> k;
for(int i=1;i<=n;i++){
cin >> arr[i];
}
bool yes = false;
for(int j=0;j<=60;j++){
if((1LL<<j)>k){
break;
}
int tot=0;
for(int i=1;i<=n;i++){
tot += arr[i]/(1LL<<j);
}
if(tot%2LL){
yes = true;
break;
}
}
if(yes){
cout << 1;
}
else{
cout << 0;
}
}
cout << "\n";
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
9 ms |
468 KB |
Output is correct |
2 |
Correct |
9 ms |
468 KB |
Output is correct |
3 |
Correct |
9 ms |
492 KB |
Output is correct |
4 |
Correct |
9 ms |
468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
340 KB |
Output is correct |
2 |
Correct |
6 ms |
332 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
17 ms |
340 KB |
Output is correct |
2 |
Correct |
17 ms |
340 KB |
Output is correct |
3 |
Correct |
17 ms |
392 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
30 ms |
412 KB |
Output is correct |
2 |
Correct |
33 ms |
2064 KB |
Output is correct |
3 |
Correct |
29 ms |
1996 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
468 KB |
Output is correct |
2 |
Correct |
10 ms |
468 KB |
Output is correct |
3 |
Correct |
10 ms |
468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
15 ms |
468 KB |
Output is correct |
2 |
Correct |
12 ms |
1344 KB |
Output is correct |
3 |
Correct |
22 ms |
1492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
14 ms |
488 KB |
Output is correct |
2 |
Correct |
18 ms |
1372 KB |
Output is correct |