제출 #855195

#제출 시각아이디문제언어결과실행 시간메모리
855195ancuber1031Intercastellar (JOI22_ho_t1)C++14
25 / 100
723 ms524288 KiB
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int,int> #define p_q priority_queue #define endl '\n' #define pb push_back signed main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); int n; cin>>n; deque<int> a(n), ans; for (auto& i : a) cin>>i; while(!a.empty()) { int cur = a.back(); a.pop_back(); if (cur&1) { ans.push_front(cur); } else { a.push_back(cur>>1); a.push_back(cur>>1); } } int q; cin>>q; while(q--) { int x; cin>>x; cout<<ans[--x]<<endl; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...