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>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int main(){
fastIO;
int tc;
cin >> tc;
for(int ti = 1; ti <= tc; ti ++ ){
int n;
ll k;
cin >> n >> k;
vector<ll> x(n);
for(int i = 0 ;i < n; i ++ ){
cin >> x[i];
}
ll cc;
bool who = false;
ll cum;
for(int lg = 0; lg < 32; lg ++ ){
cc = (1 << lg);
if(cc <= k){
cum = 0;
for(int i = 0 ; i < n; i ++) {
cum += x[i] / cc;
}
if(cum % 2 == 1){
who = true;
break;
}
}
}
if(who){
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... |