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;
int n, q;
long long x, cidx = 1;
vector<pair<long long, long long>> vec;
int main() {
cin.tie(0) -> sync_with_stdio(0);
cin >> n;
while(n--) {
cin >> x;
vec.emplace_back(cidx, (x >> __builtin_ctz(x)));
cidx += (x&-x);
}
cin >> q;
while(q--) {
cin >> x;
auto it = --upper_bound(vec.begin(), vec.end(), pair<long long, long long>(x, LLONG_MAX));
cout << it->second << '\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... |