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;
#define int long long
const int Z = 2e5;
int N, Q, A[Z], B[Z];
int32_t main() {
ios::sync_with_stdio(0), cin.tie(0);
cin >> N;
for(int i = 0; i < N; ++i) {
int u, v; cin >> u;
v = u;
while(!(v & 1))
v /= 2;
A[i] = u / v;
B[i] = v;
if(i) A[i] += A[i-1];
}
cin >> Q;
while(Q--) {
int x; cin >> x;
cout << B[lower_bound(A, A + N, x) - A] << '\n';
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |