제출 #936308

#제출 시각아이디문제언어결과실행 시간메모리
936308qwe1rt1yuiop1Intercastellar (JOI22_ho_t1)C++14
100 / 100
65 ms10712 KiB
#include <bits/stdc++.h> #define int long long using namespace std; void solve() { int n; cin >> n; vector<int> v(n); for (int &i : v) cin >> i; vector<int> a = v, b(n, 1); for (int i = 0; i < n; ++i) while (a[i] % 2 == 0) b[i] *= 2, a[i] /= 2; for (int i = 1; i < n; ++i) b[i] += b[i - 1]; int q; cin >> q; while (q--) { int x; cin >> x; int id = lower_bound(b.begin(), b.end(), x) - b.begin(); cout << a[id] << '\n'; } } signed main() { ios::sync_with_stdio(0); cin.tie(0); solve(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...