Submission #982187

#TimeUsernameProblemLanguageResultExecution timeMemory
982187AiperiiiIntercastellar (JOI22_ho_t1)C++14
25 / 100
354 ms524288 KiB
#include <bits/stdc++.h> #define int long long #define ull unsigned long long #define ff first #define ss second #define pb push_back #define all(x) x.begin(),x.end() using namespace std; signed main(){ ios_base::sync_with_stdio(); cin.tie(0);cout.tie(0); int n; cin>>n; vector <int> a(n),v; for(int i=0;i<n;i++){ cin>>a[i]; if(a[i]%2==1)v.pb(a[i]); else{ int x=a[i]; int cnt=1; while(x%2==0){ x/=2; cnt*=2; } while(cnt--)v.pb(x); } } int q; cin>>q; while(q--){ int pos; cin>>pos; cout<<v[pos-1]<<"\n"; } } /* 4 14 9 8 12 6 2 3 5 7 11 13 13 1 4 1 4 2 1 3 5 6 2 3 7 3 8 2 10 11 13 15 17 18 20 */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...