Submission #1101039

#TimeUsernameProblemLanguageResultExecution timeMemory
1101039thinknoexitIntercastellar (JOI22_ho_t1)C++17
0 / 100
1 ms476 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long; int a[100100], p[100100]; ll qs[100100]; 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--) { int x; cin >> x; cout << a[upper_bound(qs + 1, qs + 1 + n, x) - qs - 1] << '\n'; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...