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>
#define ll long long
using namespace std;
ll ori[2][200010],pre[200010];
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
ll n;
cin>>n;
for(ll i=1;i<=n;i++){
cin>>ori[0][i];
ori[1][i]=1;
while(ori[0][i]%2==0){
ori[1][i]*=2;
ori[0][i]/=2;
}
pre[i]=pre[i-1]+ori[1][i];
}
ll q;
cin>>q;
for(ll i=0;i<q;i++){
ll p;
cin>>p;
ll a=lower_bound(&pre[0],&pre[n+1],p)-&pre[0];
cout<<ori[0][a]<<"\n";
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |