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 <iostream>
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false); cin.tie(0)
#define lli long long int
#define nl "\n"
#define rep(i, a, b) for(lli i = (a); i <= (b); ++i)
#define debugsl(x) cout << #x << " = " << x << ", "
#define debug(x) debugsl(x) << endl
#define debugarr(x, a, b) cout << #x << " = ["; rep(i, a, b){ cout << x[i] << ", "; } cout << "]" << nl
#define MAXN 100003
lli t, n, k, a[MAXN], suma, paridad, pot;
int main()
{
fastio;
cin >> t;
while(t--){
cin >> n >> k;
rep(i, 1, n) cin >> a[i];
pot = 1;
while (pot <= k){
suma = 0;
rep(i, 1, n) suma += a[i] / pot;
if (suma & 1) break;
pot <<= 1;
}
cout << (suma & 1);
}
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... |