| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1156451 | Alihan_8 | Intercastellar (JOI22_ho_t1) | C++20 | 51 ms | 5444 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n; cin >> n;
vector <int> a(n), pf(n + 1);
for ( int i = 0; i < n; i++ ){
cin >> a[i];
int x = 1;
while ( a[i] % 2 == 0 ){
x <<= 1;
a[i] /= 2;
}
pf[i + 1] = pf[i] + x;
}
int q; cin >> q;
while ( q-- ){
int x; cin >> x;
int l = 1, r = n;
while ( l < r ){
int m = (l + r) / 2;
if ( pf[m] < x ) l = m + 1;
else r = m;
}
cout << a[l - 1] << '\n';
}
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
