Submission #1101042

#TimeUsernameProblemLanguageResultExecution timeMemory
1101042thinknoexitIntercastellar (JOI22_ho_t1)C++17
100 / 100
84 ms9304 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long; const int N = 200200; int a[N], p[N]; ll qs[N]; int main() { cin.tie(nullptr)->sync_with_stdio(false); int n; cin >> n; for (int i = 1;i <= n;i++) { cin >> a[i]; p[i] = 1; while (a[i] % 2 == 0) { a[i] /= 2; p[i] *= 2; } } for (int i = 1;i <= n;i++) { qs[i] = qs[i - 1] + p[i]; } int q; cin >> q; while (q--) { ll x; cin >> x; cout << a[lower_bound(qs + 1, qs + 1 + n, x) - qs] << '\n'; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...