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;
using ll = long long;
int main(){
int n;
cin >> n;
vector<ll> a(n), pow(n, 1);
for(int i = 0; i < n; i++){
cin >> a[i];
while(a[i] % 2 == 0){
a[i] /= 2;
pow[i] *= 2;
}
}
int Q, id = 0;
cin >> Q;
while(Q--){
int c, tmp = 0;
cin >> c;
while(c > tmp + pow[id]){
tmp += pow[id];
id += 1;
}
if(id < n) cout << a[id] << '\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... |