Submission #584693

#TimeUsernameProblemLanguageResultExecution timeMemory
584693rgnerdplayerIntercastellar (JOI22_ho_t1)C++17
100 / 100
67 ms7688 KiB
#include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); #ifdef LOCAL freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif auto solve = [&]() { int n; cin >> n; vector<int> a(n), b(n); for (int i = 0; i < n; i++) { cin >> a[i]; b[i] = a[i] & -a[i]; } int q; cin >> q; int i = 0; i64 s = 0; while (q--) { i64 x; cin >> x; while (s + b[i] < x) { s += b[i++]; } cout << a[i] / b[i] << '\n'; } }; solve(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...