#include<bits/stdc++.h>
using namespace std;
#define all(x) x.begin(),x.end()
#define int long long
#define ACorz ios_base::sync_with_stdio(false);cin.tie(0);
void solve(){
int n,k;cin>>n>>k;
vector<int> v(n);
vector<int> a(30);
for(int i=0;i<n;i++){
cin>>v[i];
for(int j=0;j<30;j++){
a[j]+=v[i]/(1<<j);
}
}
int flag=0;
for(int i=0;i<30;i++){
if((1<<i)<=k){
flag|=(a[i]&1);
}
}
cout<<flag;
}
int32_t main(){
ACorz;
int t=1;cin>>t;
while(t--){
solve();
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
25 ms |
600 KB |
Output is correct |
2 |
Correct |
26 ms |
600 KB |
Output is correct |
3 |
Correct |
25 ms |
600 KB |
Output is correct |
4 |
Correct |
25 ms |
604 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 |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
18 ms |
604 KB |
Output is correct |
2 |
Correct |
18 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
32 ms |
348 KB |
Output is correct |
2 |
Correct |
33 ms |
1116 KB |
Output is correct |
3 |
Correct |
32 ms |
1108 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
46 ms |
344 KB |
Output is correct |
2 |
Correct |
46 ms |
2132 KB |
Output is correct |
3 |
Correct |
47 ms |
2036 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
25 ms |
604 KB |
Output is correct |
2 |
Correct |
25 ms |
604 KB |
Output is correct |
3 |
Correct |
26 ms |
624 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
27 ms |
604 KB |
Output is correct |
2 |
Correct |
26 ms |
1468 KB |
Output is correct |
3 |
Correct |
26 ms |
1508 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
25 ms |
604 KB |
Output is correct |
2 |
Correct |
27 ms |
1368 KB |
Output is correct |