Submission #722608

#TimeUsernameProblemLanguageResultExecution timeMemory
722608ymmIntercastellar (JOI22_ho_t1)C++17
100 / 100
80 ms9200 KiB
#include <bits/stdc++.h> #define Loop(x,l,r) for (ll x = (l); x < (ll)(r); ++x) #define LoopR(x,l,r) for (ll x = (r)-1; x >= (ll)(l); --x) typedef long long ll; typedef std::pair<int, int> pii; typedef std::pair<ll , ll > pll; using namespace std; int main() { cin.tie(0) -> sync_with_stdio(false); int n; cin >> n; vector<ll> a(n), b(n+1); Loop (i,0,n) cin >> a[i]; Loop (i,0,n) b[i+1] = b[i] + (a[i] & -a[i]); int q; cin >> q; while (q--) { ll x; cin >> x; int i = lower_bound(b.begin(), b.end(), x) - b.begin() - 1; cout << a[i] / (a[i] & -a[i]) << '\n'; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...