# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
534073 | LittleOrange | Intercastellar (JOI22_ho_t1) | C++17 | 72 ms | 6836 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ios::sync_with_stdio(0);cin.tie(0);
int n;
cin >> n;
vector<ll> a(n,0);
for (int i = 0;i<n;i++){
cin >> a[i];
}
vector<pair<ll,ll> > dat(n+1);
dat[0] = {0,0};
for (int i = 0;i<n;i++){
ll v = a[i];
ll c = 1;
while (v&1^1){
v>>=1;
c<<=1;
}
dat[i+1] = {dat[i].first+c,v};
}
int q;
cin >> q;
while (q--){
ll x;
cin >> x;
cout << (*lower_bound(dat.begin(),dat.end(),make_pair(x,0LL))).second << "\n";
}
}
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... |