| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1174139 | nguyenkhangninh99 | Intercastellar (JOI22_ho_t1) | C++20 | 50 ms | 5448 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int n; cin >> n;
vector<int> a(n + 1), precnt(n + 1);
for (int i = 1; i <= n; i++){
cin >> a[i];
int cur = 1;
while (a[i] % 2 == 0){
a[i] /= 2;
cur *= 2;
}
precnt[i] = precnt[i - 1] + cur;
}
int q; cin >> q;
while (q--){
int x; cin >> x;
cout << a[lower_bound(precnt.begin(), precnt.end(), x) - precnt.begin()] << "\n";
}
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
