Submission #526436

#TimeUsernameProblemLanguageResultExecution timeMemory
526436sidonIntercastellar (JOI22_ho_t1)C++17
100 / 100
86 ms6820 KiB
#include <bits/stdc++.h> using namespace std; #define int long long const int Z = 2e5; int N, Q, A[Z], B[Z]; int32_t main() { ios::sync_with_stdio(0), cin.tie(0); cin >> N; for(int i = 0; i < N; ++i) { int u, v; cin >> u; v = u; while(!(v & 1)) v /= 2; A[i] = u / v; B[i] = v; if(i) A[i] += A[i-1]; } cin >> Q; while(Q--) { int x; cin >> x; cout << B[lower_bound(A, A + N, x) - A] << '\n'; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...