Submission #1130418

#TimeUsernameProblemLanguageResultExecution timeMemory
1130418AksLolCodingIntercastellar (JOI22_ho_t1)C++17
100 / 100
133 ms16388 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; void solve() { int n; cin >> n; vector<ll> a(n); for (auto &i: a) cin >> i; // precomp ll cnt = 1; set<pair<ll, ll>, greater<pair<ll, ll>>> s; for (int i: a) { int ctz = __builtin_ctz(i); s.insert({cnt, i >> ctz}); cnt += 1LL << ctz; } // query ll q, x; cin >> q; while (q--) { cin >> x; ll ans = s.lower_bound({x, INT_MAX})->second; cout << ans << '\n'; } } signed main() { cin.tie(0)->sync_with_stdio(0); solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...