제출 #1130416

#제출 시각아이디문제언어결과실행 시간메모리
1130416AksLolCodingIntercastellar (JOI22_ho_t1)C++17
25 / 100
104 ms14920 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<int, ll>, greater<pair<int, int>>> 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...