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 <vector>
#include <queue>
#include <algorithm>
#include <map>
#define ll long long
using namespace std;
map <ll, ll> mp;
ll n, q, k, f, s, A[100000];
int main() {
cin >> n;
for (int i=0; i<n; ++i) {
cin >> A[i];
k = 1;
while (!(A[i] & 1)) {
A[i] /= 2;
k *= 2;
}
s += k;
mp[s] = A[i];
}
cin >> q;
while (q--) {
cin >> k;
cout << mp.lower_bound(k)->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... |