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 long double ld;
typedef pair<ll,ll> pl;
typedef pair<int,int> pii;
typedef tuple<int,int,int> tt;
#define all(a) a.begin(), a.end()
#define filter(a) a.erase(unique(all(a)), a.end())
const int mn = 1e5 + 5;
int n, k, a[mn];
bool solve() {
cin >> n >> k;
int cntOdd = 0, loLSB = INT_MAX;
for (int i = 1; i <= n; i++) {
cin >> a[i];
if (a[i] & 1) cntOdd++;
loLSB = min(loLSB, (a[i] & -a[i]));
}
if (k < loLSB) return 0;
return k > 1 || (cntOdd & 1);
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int TC; cin >> TC;
while (TC--) cout << solve();
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... |