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 ll long long
#define INF 10000000000
using namespace std;
int main(){
int t;
cin>>t;
while (t--){
ll n, k;
cin>>n>>k;
vector<ll> v(n);
for (int i = 0; i < n; i++){
cin>>v[i];
}
ll d = 1, ans = 0;
while (d <= k){
ll cnt = 0;
for (int i = 0; i < n; i++){
cnt += v[i] / d;
}
if (cnt % 2 == 1){
ans = 1;
break;
}
d = 2;
}
cout<<ans;
}
}
# | 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... |