제출 #1248650

#제출 시각아이디문제언어결과실행 시간메모리
1248650arashmemarIntercastellar (JOI22_ho_t1)C++20
100 / 100
248 ms5460 KiB
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 100; pair <long long int, int> ps[maxn]; int main() { int n; cin >> n; for (int i = 1;i <= n;i++) { int inp; cin >> inp; int tmp = 1; while (inp % 2 == 0) { inp /= 2; tmp *= 2; } ps[i] = {ps[i - 1].first + tmp, inp}; } int ptr = 1; int q; cin >> q; while (q--) { long long int x; cin >> x; while (ps[ptr].first < x) { ptr++; } cout << ps[ptr].second << '\n'; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...