제출 #802033

#제출 시각아이디문제언어결과실행 시간메모리
802033acatmeowmeowIntercastellar (JOI22_ho_t1)C++11
100 / 100
65 ms8184 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...