Submission #1166018

#TimeUsernameProblemLanguageResultExecution timeMemory
1166018novemnotesIntercastellar (JOI22_ho_t1)C++20
25 / 100
958 ms589824 KiB
#include <bits/stdc++.h> using namespace std; int n; vector<int> ans; void solve(int x){ if(x%2==1)ans.push_back(x); else for(int i=0;i<2;i++)solve(x/2); } int main(){ cin.tie(nullptr)->sync_with_stdio(false); cin >> n; while(n--){ int x;cin >> x; solve(x); } int q;cin >> q; while(q--){ int x;cin >> x; x--; cout << ans[x] << "\n"; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...