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
signed main() {
//your code goes here
int n;
cin >> n;
vector <int> arr = {};
for(int i = 0; i < n; i++) {
int num;
cin >> num;
int val = 1;
// cout << num << " b " << endl;
while(num%2 == 0) {
val *= 2;
num /= 2;
}
// cout << num << " v " << endl;
for(int i = 1; i <= val; i++) {
arr.push_back(num);
}
}
int q;
cin >> q;
for(int i = 0; i < q; i++) {
int x;
cin >> x;
cout << arr[x-1] << endl;
}
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... |