Submission #527676

#TimeUsernameProblemLanguageResultExecution timeMemory
5276768e7Intercastellar (JOI22_ho_t1)C++17
100 / 100
78 ms8864 KiB
//Challenge: Accepted #include <bits/stdc++.h> using namespace std; #ifdef zisk void debug(){cout << endl;} template<class T, class ... U> void debug(T a, U ... b){cout << a << " ", debug(b...);} template<class T> void pary(T l, T r) { while (l != r) cout << *l << " ", l++; cout << endl; } #else #define debug(...) 0 #define pary(...) 0 #endif #define ll long long #define maxn 200005 #define pii pair<int, int> #define ff first #define ss second #define io ios_base::sync_with_stdio(0);cin.tie(0); ll a[maxn], que[maxn]; int main() { io int n; cin >> n; for (int i = 0;i < n;i++) cin >> a[i]; int q; cin >> q; for (int i = 0;i < q;i++) cin >> que[i]; ll cur = 0, ind = 0; for (int i = 0;i < q;i++) { while (ind < n && cur + (a[ind] & (-a[ind])) < que[i]) { cur += a[ind] & (-a[ind]); ind++; } cout << a[ind] / (a[ind] & (-a[ind])) << "\n"; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...