Submission #676618

#TimeUsernameProblemLanguageResultExecution timeMemory
676618owoovoIntercastellar (JOI22_ho_t1)C++14
100 / 100
95 ms10756 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...