| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 1279244 | hoa208 | Intercastellar (JOI22_ho_t1) | C++20 | 45 ms | 5800 KiB | 
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i, a, b) for (int i = (a), _b = (b); i <= _b; i++)
#define FORD(i, b, a) for (int i = (b), _a = (a); i >= _a; i--)
#define pa pair<ll, ll>
#define fi first
#define se second
#define bit(mask, j) ((mask >> j) & 1)
const   ll mod = 1e9 + 7;
const   ll INF = 1e18;
//--------------------------------------------------------------------
const ll N = 2e5 + 10;
ll a[N], qr[N];
void hbmt() {
    ll n;
    cin >> n;
    FOR(i, 1, n) {
        cin >> a[i];
    }    
    ll q;
    cin >> q;
    FOR(i, 1, q) {
        cin >> qr[i];
    }
    ll sum = 0;
    ll id = 1;
    FOR(i, 1, n) {
        ll val = 1;
        while(a[i] % 2 == 0) {
            a[i] /= 2;
            val *= 2;
        }
        sum += val;
        while(id <= q && qr[id] <= sum) {
            cout << a[i] << '\n';
            id++;
        }
    }
}
int main() {
    
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    #define NAME "hbmt"
    if(fopen(NAME".inp", "r")) {
        freopen(NAME".inp", "r", stdin);
        freopen(NAME".out", "w", stdout);
    }
    
    //int t;cin>>t;while(t--)
    hbmt();
    return 0;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
