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>
#define int long long
using namespace std;
int32_t main()
{
int t;
cin>>t;
while(t--){
int n,k;
cin>>n>>k;
vector<int>v(n);
int cnt[65]={0};
for(int i=0;i<n;i++){
cin>>v[i];
for(int j=0;j<40;j++){
cnt[j]+=v[i]/(1ll<<j);
}
}
int f=0;
for(int i=0;i<40;i++){
if(k>=(1ll<<i)&&(cnt[i]%2) ) f=1;
}
if(n==1&&v[0]<=k) f=1;
if(f) cout<<1;
else cout<<0;
}
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... |