Submission #855795

#TimeUsernameProblemLanguageResultExecution timeMemory
855795annabeth9680Intercastellar (JOI22_ho_t1)C++17
100 / 100
56 ms8892 KiB
#include <bits/stdc++.h> #define int long long using namespace std; int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int N; cin >> N; vector<pair<int,int>> arr; for(int i = 0;i<N;++i){ int x; cin >> x; int p = 1; while(x % 2 == 0){ x /= 2; p *= 2; } arr.push_back({x,p}); //cout << x << " " << p << "\n"; } int Q; cin >> Q; int pos = 0, cur = 0; for(int i = 0;i<Q;++i){ int a; cin >> a; while(cur+arr[pos].second < a){ cur += arr[pos].second; pos++; } cout << arr[pos].first << "\n"; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...