# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
802033 | acatmeowmeow | Intercastellar (JOI22_ho_t1) | C++11 | 65 ms | 8184 KiB |
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 N = 2e5;
int n, q, arr[N + 5], b[N + 5];
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> arr[i];
b[i] = 1;
while (arr[i] % 2 == 0) b[i] *= 2, arr[i] /= 2;
b[i] += b[i - 1];
}
cin >> q;
while (q--) {
int x;
cin >> x;
int index = lower_bound(b + 1, b + n + 1, x) - (b + 1) + 1;
cout << arr[index] << '\n';
}
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... |