Submission #923312

#TimeUsernameProblemLanguageResultExecution timeMemory
923312goodspeed0208Intercastellar (JOI22_ho_t1)C++14
100 / 100
56 ms10832 KiB
#include<bits/stdc++.h> #define int long long #define pii pair<int, int> using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<int>v(n); for (auto &i : v) cin >> i; vector<pii>p(n); for (int i = 0 ; i < n ; i++) { int num = 1; while (v[i] % 2 == 0) { v[i] /= 2; num *= 2; } if (i == 0) p[i] = {num, v[i]}; else p[i] = {num + p[i-1].first, v[i]}; //cout << p[i].first << " " << p[i].second << "\n"; } int q, x, l = 0; cin >> q; while (q--) { cin >> x; while (x > p[l].first) l++; cout << p[l].second << "\n"; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...